KhronosGroup / KhronosGroup/glslang

GLSL_EXT_structured_descriptor_heap doesn't prevent invalid stores

Open
#4,399 0 comments 0 reactions 0 assignees View on GitHub
bug Descriptor Heaps
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

```glsl
#version 460
#extension GL_EXT_descriptor_heap : require
#extension GL_EXT_samplerless_texture_functions : require
#extension GL_EXT_structured_descriptor_heap : require
#extension GL_EXT_scalar_block_layout : require

layout(local_size_x = 1) in;

layout(buffer_type, scalar) buffer DataBuffer {
uint data0;
uint data1;
};

layout(heap_offset = 0) resourceheap BufferHeap0 {
uint count;
DataBuffer dataBuffer;
} bufferHeap0;

void main() {
bufferHeap0.count = 3;
}
```

is invalid (and will produce invalid SPIR-V) because you can't write to the heap as it is in `UniformConstant`

@Guang-035 / @ShchchowAMD can you guys please add this test and fix what you added in https://github.com/KhronosGroup/glslang/pull/4272

Contributor guide

Open the contributing guide

Research direction

Start with the GLSL reproducer in the issue and inspect the structured descriptor heap implementation introduced by pull request 4272. Add the requested regression test, then run the relevant glslang test or validation flow to confirm this invalid store no longer produces invalid SPIR-V.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.