From bcef333a7870888ec7fdc0a2ec4dfcd42835a062 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Mon, 27 Apr 2015 10:03:25 +0000 Subject: [PATCH] SPV: Emit layout(index=) as Index decoration. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@30939 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- SPIRV/GlslangToSpv.cpp | 2 ++ SPIRV/SpvBuilder.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 65922b4a..ec0d95ec 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -2393,6 +2393,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol addDecoration(id, TranslateInterpolationDecoration(symbol->getType())); if (symbol->getQualifier().hasLocation()) builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); + if (symbol->getQualifier().hasIndex()) + builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); if (symbol->getQualifier().hasComponent()) builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); if (glslangIntermediate->getXfbMode()) { diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 6b7f3d6d..29dabb80 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -450,7 +450,7 @@ Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned value) const return 0; } -// Version findScalarConstant (see above) for scalars that take two operands (e.g. a 'double'). +// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double'). Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned v1, unsigned v2) const { Instruction* constant;