KhronosGroup / KhronosGroup/glslang
Copying a struct with a bool produces invalid select statement
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
https://godbolt.org/z/srbW3T8Tc
```glsl
#version 460
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require
#extension GL_EXT_buffer_reference2 : require
struct S1 { bool x; };
layout(set = 0, binding = 1) restrict readonly buffer SSBO {
S1 s1;
} InBuffer;
layout(buffer_reference) buffer MyBuffer {
S1 s1;
};
void main() {
MyBuffer payload;
payload.s1 = InBuffer.s1;
}
```
generates invalid SPIR-V
```
Expected bool scalar or vector type as condition: Select
%29 = OpSelect %uint %28 %uint_1 %uint_0
```
Contributor guide
Research direction
Start with the Godbolt reproducer in the issue and inspect the generated SPIR-V around the reported OpSelect diagnostic. Done means the struct-copy example no longer generates invalid SPIR-V with a non-boolean select condition.
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
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100