Add support for PhysicalStorageBuffer #237
Draft
+381
−100
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.
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