Add groundwork for GLSL_EXT_structured_descriptor_heap in glslang#4272
Add groundwork for GLSL_EXT_structured_descriptor_heap in glslang#4272Guang-035 wants to merge 10 commits into
Conversation
64b6b98 to
284dd8c
Compare
ad639fd to
5262583
Compare
|
NOTE: These validation failures are expected for now and should be fixed in SPIRV-Tools validation.
Fix is available here [Merged]. |
5262583 to
658e0cf
Compare
|
ping for review |
Apply heap_offset as an access-time descriptor heap base offset for literal, spec-constant, and push-constant values, with tests covering buffer, image, texture, and sampler heap access.
Allow inline buffer_reference blocks in structured descriptor heap declarations and reduce duplicate shifted heap base generation. Add SPIR-V coverage for buffer reference heap members and update affected baselines.
Cover acceleration structure, matrix layout, and heap buffer layout qualifier cases for structured descriptor heaps. Emit matrix layout decorations for descriptor heap structs that use OffsetIdEXT.
5f25599 to
dce6815
Compare
|
Rebase Guang-035:structured_descriptor_heap branch. |
Issue: KhronosGroup#4238 Propagate readonly/writeonly qualifiers for descriptor heap resources to valid SPIR-V decoration targets. 1. For buffer descriptors, preserve the qualifiers on OpBufferPointerEXT results using NonWritable for readonly buffers and NonReadable for writeonly buffers. 2. For direct descriptor heap image arrays, synthesize one-member wrapper block types so NonReadable/NonWritable can be emitted as member decorations instead of decorating OpLoad results, which is not valid SPIR-V. 3. Add regression coverage for descriptor heap buffer and image qualifier lowering.
|
The new commit handles readonly / writeonly qualifiers for resources loaded from descriptor heaps. Issue reported here . |
| extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisable; | ||
| extensionBehavior[E_GL_EXT_null_initializer] = EBhDisable; | ||
| extensionBehavior[E_GL_EXT_descriptor_heap] = EBhDisable; | ||
| extensionBehavior[E_GL_EXT_structured_descriptor_heap] = EBhDisable; |
There was a problem hiding this comment.
Is the GLSL spec stable already? Or is this PR blocked until the spec is merged.
There was a problem hiding this comment.
The GLSL spec is stable, but it has not been merged yet. This PR is intended to track the current implementation and gather review feedback. I will keep it open and not merge it until the spec lands.
| parseContext.setLayoutQualifier($1.loc, $$, *$1.string); | ||
| } | ||
| | IDENTIFIER EQUAL constant_expression { | ||
| | IDENTIFIER EQUAL assignment_expression { |
There was a problem hiding this comment.
Related to the previous comment here. Could you add a test that produces a diagnostic if the expression is not constant? (not sure if you have one already).
There was a problem hiding this comment.
Good point, I missed adding coverage for this when resolving the previous comment. I added spv.layoutQualifierExpression.error.comp to verify that non-constant expressions used with regular layout qualifiers still produce the expected constant expression required diagnostic.
| StorageClass descHeapStorageClass; // for descriptor heap, record its basic storage class. | ||
| uint32_t descHeapBaseArrayStride; // for descriptor heap, record its explicit array stride. | ||
| Id descHeapBaseOffset; // byte offset applied to the heap base before descriptor lookup. | ||
| std::vector<Id> descHeapindexChain; |
There was a problem hiding this comment.
spelling nit: descHeapIndexChain is more consistent with the spelling of other fields (capital I in index).
This PR implements
GLSL_EXT_structured_descriptor_heapsupport in glslang.It builds on the existing
GL_EXT_descriptor_heaplowering and extends the frontend/backend metadata model so structured heap layout can distinguish ordinary POD members from real descriptor payloads.Spec reference: https://github.com/KhronosGroup/GLSL/pull/299/changes
Task Breakdown
buffer_typelayout qualifier onuniform/bufferblocksdescriptor_size =onresourceheap/samplerheapblock membersheap_offset =onresourceheap/samplerheapblocksbuffer_referenceandbuffer_reference =on buffer block members used byresourceheap/samplerheaprow_major/column_majoron matrix block members inresourceheap/samplerheapoffset =onresourceheap/samplerheapblock membersstd140,std430, andscalaron buffer/uniform blocks used byresourceheap/samplerheap