add SpecConstantOpModeGuard to GlslangToSpvTraverser::visitSymbol()

This commit is contained in:
qining
2016-04-06 14:42:01 -04:00
parent 408876600f
commit 75d1d80109
2 changed files with 8 additions and 4 deletions

View File

@@ -778,6 +778,10 @@ TGlslangToSpvTraverser::~TGlslangToSpvTraverser()
//
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.
// Formal function parameters were mapped during makeFunctions().
spv::Id id = getSymbolId(symbol);