From 4cdfb998448e58a3b4c1cda7b85e3f49c9d86596 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 20 Apr 2021 18:28:23 +0300 Subject: [PATCH] Put specialization constant instructions in the right section in SPIR-V --- source/glsl/spirv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index 44c1eb87..1cce97df 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -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) -- 2.45.2