This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Initial work for bindless buffers & textures in rust-gpu#450
Merged
Jasper-Bekkers merged 65 commits intomainfrom May 5, 2021
Merged
Initial work for bindless buffers & textures in rust-gpu#450Jasper-Bekkers merged 65 commits intomainfrom
Jasper-Bekkers merged 65 commits intomainfrom
Conversation
Jasper-Bekkers
commented
Feb 25, 2021
Jasper-Bekkers
commented
Feb 25, 2021
Jasper-Bekkers
commented
Feb 25, 2021
Jasper-Bekkers
commented
Feb 25, 2021
Jasper-Bekkers
commented
Feb 25, 2021
Jasper-Bekkers
commented
Feb 25, 2021
Comment on lines
+10
to
+22
| /// This handle is expected to be used engine-side to refer to descriptors within a descriptor set. | ||
| /// To be able to use the bindless system in rust-gpu, an engine is expected to have created | ||
| /// four DescriptorSets, each containing a large table of max 1 << 23 elements for each type. | ||
| /// And to sub-allocate descriptors from those tables. It must use `RenderResourceHandle` to | ||
| /// refer to slots within this table, and it's then expected that these RenderResourceHandle's | ||
| /// are freely copied to the GPU to refer to resources there. | ||
| /// | ||
| /// | Buffer Type | Set | | ||
| /// |------------------|-----| | ||
| /// | Buffers | 0 | | ||
| /// | Textures | 1 | | ||
| /// | Storage textures | 2 | | ||
| /// | Tlas | 3 | |
Contributor
Author
There was a problem hiding this comment.
These will be hard requirements on a CPU runtime implementing a Vulkan renderer. Samplers aren't yet in this list because they're quite controversial here and a bit of a trade-off.
On low-end devices only 4 descriptor sets are guaranteed to exist for us to use. I've chosen here to dedicate the 4 slots like this and later on require only the use of immutable samplers. This is a bit of a contentious topic of course since low-end GPUs with limited DescriptorSets are ... rare, and having actual Samplers might be more useful.
cdac5f5 to
a09d1c2
Compare
This was referenced Mar 31, 2021
…self.zombie_ptr_equal` borrow the same refcell
…ride some OpEntryPoint parameters when using bindless in spirv 1.5, and it's useful to be able to sanity check calls into bindless functions
…dation layer complains so we need to sort all OpVariable's with Function scope to be in the first block of a function
…his case anymore now that we do proper error checking around binding and descriptor_set attributes
…, this way we don't require a nightly feature on the CPU side
khyperia
approved these changes
May 5, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While a lot of this stuff is still in flux (naming wise, most code is in a terrible location, etc). I wanted to share the work so-far to gather some feedback.
There are several reasons for adding bindless support to
rust-gpu;Relevant MCP: #389
Example of how to use:
Draft because; lots of work still left to do.
storemethod onBufferStorageTextureStructuredBuffer<T>equivalent that can function as an array instead of a "bag of bytes" likeBufferTextureTextureto use the generics that recently got added.Texture1dandTexture3d