KhronosGroup / KhronosGroup/glslang
GL_EXT_descriptor_heap 2D array not handled correctly
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
```glsl
#version 450
#extension GL_EXT_descriptor_heap : require
layout(descriptor_heap) buffer Heap {
uint data;
} heap[3][3];
void main() {
heap[1][2].data = 42;
}
```
in the 1.4.350 SDK version returns
> WARNING: '[][]' : Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource
which is a bit misleading and then generates `heap[]` code on the user (without telling them)
ToT just crashes with
> GlslangToSpv.cpp:515: spv::Decoration (anonymous namespace)::TranslateLayoutDecoration(const glslang::TType &, glslang::TLayoutMatrix): Assertion `0' failed.
... this should be handled better
cc @ShchchowAMD @Tobski inspired by https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/6645#note_612544
Contributor guide
Research direction
Reproduce the issue with the provided GLSL shader using the current glslang build, then inspect GlslangToSpv.cpp around line 515 where the assertion occurs. Compare the warning and generated output with the 2D descriptor-heap array in the reproducer; done means this input is handled without a crash or silently reduced array shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100