Repository navigation
Descriptor Heap Support #524
Description
Activity
- changed the title
[-]Support: SPV_EXT_descriptor_heap & SPV_KHR_untyped_pointers Support (Descriptor Heap Support)[/-][+]Descriptor Heap Support[/+]on Feb 10, 2026 You're the third to ask me about descriptor heaps, ping @FacelessTiger :D
On branch asm_fn_ptr I made prototypes to declare the entry point in
asm!blocks, which would allow end users with advanced entry point requirements to directly emit whatever SPIR-V they want to output. Example:rust-gpu/tests/compiletests/ui/spirv-attr/entry/entry1_global_asm.rs
Lines 20 to 57 in 3c72edc
#[inline] pub fn main(input: Vec4, out: &mut Vec4) { *out = input + 1.; } pub fn entry() { unsafe { let mut input = Vec4::default(); asm! { "%input = OpVariable typeof{input} Input", "OpName %input \"input\"", "OpDecorate %input Location 0", "%tmp = OpLoad typeof*{input} %input", "OpStore {input} %tmp", input = in(reg) &mut input, }; let mut output = Vec4::default(); main(input, &mut output); asm! { "%output = OpVariable typeof{output} Output", "OpName %output \"output\"", "OpDecorate %output Location 0", "%tmp = OpLoad _ {output}", "OpStore %output %tmp", output = in(reg) &output, }; } } /// we don't support `global_asm!` yet pub fn non_global_asm() { unsafe { asm! { "OpEntryPoint Vertex {entry} \"main\"", entry = in(reg) entry, } } } Primarily, I want to move our entry point system from being a compiler internal thing to a "simple" proc macro you can expand, inspect and modify more easily. We could also have a proc macro for descriptor heaps, or you could use said assembly directly.
I've had some trouble getting buffers to work, but got a hint that this works so may revisit this soon.
The compiletest prototypes in #534 may be interesting reference on how this could be implemented
+1 requesting for this feature. Are there any updates?
Unlikely that I'll get around to this relatively niche feature. But if you're willing to toy around with inline
asm!blocks, you could probably get it working without having to modify the compiler.
Whilst descriptor heap can be used with regular descriptor sets/bindings.
It also allows for untyped access which is much more flexible.
https://github.khronos.org/SPIRV-Registry/extensions/EXT/SPV_EXT_descriptor_heap.html
https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_untyped_pointers.html
https://github.com/KhronosGroup/SPIRV-Guide/blob/main/chapters/untyped_pointers.md
https://docs.vulkan.org/guide/latest/descriptor_heap.html#_untyped_shader_model
https://docs.vulkan.org/refpages/latest/refpages/source/VK_EXT_descriptor_heap.html
https://docs.vulkan.org/features/latest/features/proposals/VK_EXT_descriptor_heap.html