add SpecConstantOpModeGuard to GlslangToSpvTraverser::visitSymbol()
This commit is contained in:
@@ -778,6 +778,10 @@ TGlslangToSpvTraverser::~TGlslangToSpvTraverser()
|
|||||||
//
|
//
|
||||||
void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
||||||
{
|
{
|
||||||
|
SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
|
||||||
|
if (symbol->getType().getQualifier().isSpecConstant())
|
||||||
|
spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
|
||||||
|
|
||||||
// getSymbolId() will set up all the IO decorations on the first call.
|
// getSymbolId() will set up all the IO decorations on the first call.
|
||||||
// Formal function parameters were mapped during makeFunctions().
|
// Formal function parameters were mapped during makeFunctions().
|
||||||
spv::Id id = getSymbolId(symbol);
|
spv::Id id = getSymbolId(symbol);
|
||||||
|
|||||||
@@ -112,15 +112,15 @@ Linked vertex stage:
|
|||||||
98: 68(ivec4) ConstantComposite 97 97 97 97
|
98: 68(ivec4) ConstantComposite 97 97 97 97
|
||||||
99: 68(ivec4) SpecConstantOp 198 71 98
|
99: 68(ivec4) SpecConstantOp 198 71 98
|
||||||
100: 25(int) Constant 0
|
100: 25(int) Constant 0
|
||||||
|
101: 6(int) SpecConstantOp 81 67 0
|
||||||
102: TypeVector 6(int) 2
|
102: TypeVector 6(int) 2
|
||||||
|
103: 102(ivec2) SpecConstantOp 79 67 67 1(GLSL.std.450) 0
|
||||||
104: TypeVector 6(int) 3
|
104: TypeVector 6(int) 3
|
||||||
|
105: 104(ivec3) SpecConstantOp 79 67 67 2 1(GLSL.std.450) 0
|
||||||
|
106: 65(ivec4) SpecConstantOp 79 67 67 1(GLSL.std.450) 2 0 3
|
||||||
4(main): 2 Function None 3
|
4(main): 2 Function None 3
|
||||||
5: Label
|
5: Label
|
||||||
Return
|
Return
|
||||||
101: 6(int) CompositeExtract 67 0
|
|
||||||
103: 102(ivec2) VectorShuffle 67 67 1 0
|
|
||||||
105: 104(ivec3) VectorShuffle 67 67 2 1 0
|
|
||||||
106: 65(ivec4) VectorShuffle 67 67 1 2 0 3
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
8(non_const_array_size_from_spec_const(): 6(int) Function None 7
|
8(non_const_array_size_from_spec_const(): 6(int) Function None 7
|
||||||
9: Label
|
9: Label
|
||||||
|
|||||||
Reference in New Issue
Block a user