Skip to content

Add SPV_EXT_descriptor_heap test fixtures - #342

Closed
chaoticbob wants to merge 2 commits into
mainfrom
descriptor-heap
Closed

Add SPV_EXT_descriptor_heap test fixtures#342
chaoticbob wants to merge 2 commits into
mainfrom
descriptor-heap

Conversation

@chaoticbob

Copy link
Copy Markdown
Contributor

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 descriptor
types. 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 to
preserve 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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean for a stride?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for the YAML, nice if we put a comment next to it like

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heap test has no heap access?

- *bv17 # "push"
specialization_constant_count: 0,
specialization_constants:
entry_point_heap_accesses:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, no heap access?

@spencer-lunarg spencer-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. we should remove the tests/descriptor_heap not using the new spirv extension
  2. we should print out a comment when stride is UINT32_T max

@chaoticbob

Copy link
Copy Markdown
Contributor Author

Closing in favor of a combined PR with #343.

@chaoticbob chaoticbob closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants