Skip to content

Internal error during optimization for OpDecorateString with multiple literals #1487

@theagentd

Description

@theagentd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions