-
Notifications
You must be signed in to change notification settings - Fork 244
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
Initial work for bindless buffers & textures in rust-gpu #450
Conversation
crates/spirv-std/src/bindless.rs
Outdated
/// 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 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
…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
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.
store
method onBuffer
StorageTexture
StructuredBuffer<T>
equivalent that can function as an array instead of a "bag of bytes" likeBuffer
Texture
Texture
to use the generics that recently got added.Texture1d
andTexture3d