-
Notifications
You must be signed in to change notification settings - Fork 60
Add support for PhysicalStorageBuffer #237
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
base: main
Are you sure you want to change the base?
Conversation
Turns out I am porting a shader that needs this too! |
Are physical pointers more performant than using descriptor indexing? Are they similar to 32-bit handles used for bindless in DirectX? Sorry for asking here, but I haven't found documentation on them. |
Will pick it up again soon!
There is no direct equivalent in DX (yet?). Buffer device addresses/physical storage buffer pointers are literally 64-bit pointers to GPU memory. That means, compared to descriptors
They behave a little different and might take different data paths, so the question performance is not trivial. But in general they should be superior. |
Summary
This adds support for
SPV_KHR_physical_storage_buffer
and thePhysicalStorageBuffer64
addressing model and expands support for physical pointers.Includes
Motivation
Allow taking advantage of physical buffer addresses (
VK_KHR_buffer_device_address
) for more flexible bindless storage buffer access.While physical pointers are largely optional with increasing support for bindless storage buffers,
fully descriptor-less storage buffers remain very ergonomic, especially in pure compute and ray-tracing shaders.
This allows, for example:
Implementation steps
PhysicalStorageBuffer64
whenPhysicalStorageBufferAddresses
is supportedu64 as *mut T
and vice versaAligned
Aligned
operands for all memory operationsqptr
store
/load
lowering/liftingRestrictedPointer
if/where necessaryspirv_std
utilities for working with physical pointersPhysicalPtr<T>
type that wraps physical addresses. /bikeshed*mut
Prior work
OpConvertUToPtr
support #119: As noted theqptr
route is the most flexible and custom constraints for each instruction don't scale. For example supportingOpBitcast
would be hard to model with custom constraints.Open questions