Internal error during optimization for OpDecorateString with multiple literals
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 445
- Avg merge
- 11h 6m
- Merged PRs (30d)
- 6
Description
The following GLSL fragment shader fails to compile to SPIR-V when optimizations are turned on:
```
#extension GL_EXT_spirv_intrinsics : require
spirv_decorate_string(5635, "string1", "string2") layout(location = 0) out float test;
void main() {
test = 0.0;
}
```
It seems that the optimizer does not handle OpDecorateString opcodes that have multiple string literals correctly.
```
shaderc: internal error: compilation succeeded but failed to optimize: Invalid instruction OpDecorateString starting at word 184: expected no more operands after 5 words, but stated word count is 7.
```
Without optimizations, the shader compiles correctly, and both the "string1" and "string2" literals are correctly included in the resulting OpDecorateString, so clearly the error is invalid; the OpDecorateString instruction IS valid and correct.
Contributor guide
Assessment
This issue has not been assessed yet.