Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindless textures #1057

Merged
merged 10 commits into from Jul 3, 2015

Conversation

@tomaka
Copy link
Member

commented Jul 2, 2015

Summary of the changes:

  • The buffer types no longer require their content to Send or 'static, except for buffers types which don't have type information.
  • Add the TextureHandle<'a> type that can be put into uniform buffers/SSBOs. Vertex buffers and regular uniforms are not yet supported.
  • A texture can be turned into a ResidentTexture by calling resident or resident_if_supported.
  • A TextureHandle<'a> can be built from a &'a ResidentTexture and can't outlive the resident texture.

The implementation should be entirely safe.

Future work:

  • Add bindless textures support for vertex buffers and regular uniforms.
  • Support using a sampler.
  • Image load/store.
  • Consider strong typing, with ResidentTexture2dArray and Texture2dArrayHandle for example.

Close #243
cc #878

@tomaka tomaka referenced this pull request Jul 2, 2015

Open

Approaching zero driver overhead #878

7 of 9 tasks complete
@tomaka

This comment has been minimized.

Copy link
Member Author

commented Jul 2, 2015

Someone made a good remark on IRC. If ResidentTexture takes ownership of the texture, that means we can't use the same texture with multiple different samplers. This is bad.

@tomaka

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2015

There are two solutions:

  • Either make ResidentTexture take a reference to a texture instead of taking ownership of it.
  • Or make ResidentTexture hold multiple handles, one per sampler. This would require changing TextureHandle::set(&ResidentTexture) to TextureHandle::set(&ResidentTexture, &SamplerBehavior).

I think that the second option is much easier to use for the user.

@tomaka tomaka force-pushed the bindless-textures branch from 73f1639 to ce322b6 Jul 3, 2015

@tomaka tomaka force-pushed the bindless-textures branch from d291ec4 to cd1c8b0 Jul 3, 2015

tomaka added a commit that referenced this pull request Jul 3, 2015

@tomaka tomaka merged commit 293e39a into master Jul 3, 2015

1 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details

@tomaka tomaka deleted the bindless-textures branch Jul 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.