Add SPV_EXT_descriptor_heap test fixtures - #342
Conversation
Adds tests/descriptor_heap/{glsl,slang}/ with bindless and per-draw
fixtures that exercise the SPV_EXT_descriptor_heap reflection path, plus
two slang-only compute fixtures: multi_type_heap.comp.spv covers
sampled-image, storage-image, uniform/storage texel-buffer, and
storage-buffer (StructuredBuffer/RWStructuredBuffer via OpTypeBufferEXT)
slots in a single entry point's call graph; as_heap.comp.spv covers the
acceleration-structure heap path.
Regenerates 113 existing goldens to pick up the new
entry_point_heap_accesses YAML section emitted by the library half of
this change. The three user_type/byte_address_buffer* and
rw_byte_address_buffer goldens were patched by hand instead of
mechanically regenerated, preserving the pre-existing offset-ordering
mismatch tracked as upstream issue #307 so that signal stays visible.
Registers the new fixtures in tests/test-spirv-reflect.cpp.
This commit depends on the library changes in the follow-up PR; on its
own the goldens will not match what the unchanged library produces.
Drops the dependency on nvshaders/slang_types.h. The local shaderio.h files now define everything they need: the GLSL variant inlines the two HLSL-style type aliases (float4x4 -> mat4, float3 -> vec3) used by the shared struct definitions, and the Slang variant uses native types directly. Updates the // Compile: hint lines in the four GLSL and two Slang sources that include shaderio.h to drop the -I paths into nvpro-samples so anyone with glslang/slangc can rebuild the fixtures with no out-of-tree dependencies. Recompiled SPVs are byte-identical to the ones already committed, so no golden regeneration is needed. The two slang-only compute fixtures (multi_type_heap, as_heap) do not include shaderio.h and were already self-contained.
| resource_heap_accesses: | ||
| - heap_name: "resource_heap" | ||
| runtime_array_type_id: 55 | ||
| stride: 4294967295 |
There was a problem hiding this comment.
what does this mean for a stride?
There was a problem hiding this comment.
UINT32_MAX means that a stride was not specified in the shader and the application will know what to do. This usually means pulling the descriptor size properties from the physical device.
There was a problem hiding this comment.
I guess for the YAML, nice if we put a comment next to it like
| stride: 4294967295 | |
| stride: 4294967295 # UNKNOWN |
or what ever we normally do
| @@ -0,0 +1,104 @@ | |||
| // Compile: glslang -V --target-env vulkan1.3 -S vert -e main -o bindless.vert.spv bindless.vert.glsl | |||
There was a problem hiding this comment.
what is this test? What is it testing and why is it in descriptor_heap folder?
|
|
||
| layout(location = 0) out vec4 outColor; | ||
|
|
||
| // Per-draw mode: 6 face textures mapped via the descriptor heap mapping API. |
There was a problem hiding this comment.
The whole point of the Descriptor Heap Mapping API is that people did NOT have to change their SPIR-V and just use Vulkan to do it all
... I think this test is noise and misleading as it offers nothing extra and confusing why there is not SPV_EXT_descriptor_heap in it
| DrawData draw; | ||
| }; | ||
|
|
||
| // Per-draw mode: the CPU issues one draw call per cube, pushing DrawData each |
There was a problem hiding this comment.
same thing, this test is not useful nor has SPV_EXT_descriptor_heap
| - *bv15 # "push" | ||
| specialization_constant_count: 0, | ||
| specialization_constants: | ||
| entry_point_heap_accesses: |
There was a problem hiding this comment.
heap test has no heap access?
| - *bv17 # "push" | ||
| specialization_constant_count: 0, | ||
| specialization_constants: | ||
| entry_point_heap_accesses: |
There was a problem hiding this comment.
same, no heap access?
spencer-lunarg
left a comment
There was a problem hiding this comment.
- we should remove the
tests/descriptor_heapnot using the new spirv extension - we should print out a comment when stride is UINT32_T max
|
Closing in favor of a combined PR with #343. |
Part 1 of 2 for #339. Adds bindless/per-draw fixtures under
tests/descriptor_heap/{glsl,slang}/plus two compute fixtures(
multi_type_heap,as_heap) covering all heap-permitted descriptortypes. Regenerates 113 goldens for the new
entry_point_heap_accesses:YAML section emitted by part 2.
The 3
user_type/byte_address_buffer*goldens were patched by hand topreserve the pre-existing offset-ordering mismatch (#307).
Linux CI will be red on this PR alone — the goldens reference output
the unchanged library doesn't emit. Stacked PR2 contains the library
half and turns CI green.