]> git.tdb.fi Git - libs/gl.git/commitdiff
Put specialization constant instructions in the right section in SPIR-V
authorMikko Rasa <tdb@tdb.fi>
Tue, 20 Apr 2021 15:28:23 +0000 (18:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 20 Apr 2021 15:28:23 +0000 (18:28 +0300)
source/glsl/spirv.cpp

index 44c1eb87a4c382a4c4735df44361c4188a5a633b..1cce97dfbf34888580ab6137140127e6fc67b094 100644 (file)
@@ -394,9 +394,9 @@ SpirVGenerator::Id SpirVGenerator::begin_expression(Opcode opcode, Id type_id, u
                writer.begin_op(content.function_body, opcode, (n_args ? 1+has_result*2+n_args : 0));
        }
        else if(opcode==OP_COMPOSITE_CONSTRUCT)
-               writer.begin_op(content.function_body, OP_SPEC_CONSTANT_COMPOSITE, (n_args ? 1+has_result*2+n_args : 0));
+               writer.begin_op(content.globals, OP_SPEC_CONSTANT_COMPOSITE, (n_args ? 1+has_result*2+n_args : 0));
        else
-               writer.begin_op(content.function_body, OP_SPEC_CONSTANT_OP, (n_args ? 2+has_result*2+n_args : 0));
+               writer.begin_op(content.globals, OP_SPEC_CONSTANT_OP, (n_args ? 2+has_result*2+n_args : 0));
 
        Id result_id = next_id++;
        if(has_result)