Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error during optimization for OpDecorateString with multiple literals #1487

Open
theagentd opened this issue Mar 17, 2025 · 0 comments

Comments

@theagentd
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant