Front-end infrastructure: Encapsulate semantic-level questions/actions about const/temp.

Much about const or temp is mechanical, about actual declaration,
while much is semantic, about something higher level.  This commit
checks every use everywhere, and for the high-level ones, substitutes
an encapsulated version instead.
This commit is contained in:
John Kessenich
2016-03-20 00:46:02 -06:00
parent 952543e757
commit 7cc0e2896e
5 changed files with 45 additions and 25 deletions

View File

@@ -1629,7 +1629,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
// First, steer off constants, which are not SPIR-V variables, but
// can still have a mapping to a SPIR-V Id.
// This includes specialization constants.
if (node->getQualifier().storage == glslang::EvqConst) {
if (node->getQualifier().isConstant()) {
return createSpvSpecConstant(*node);
}
@@ -3732,7 +3732,7 @@ void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::De
// - when running into a non-spec-constant, switch to createSpvConstant()
spv::Id TGlslangToSpvTraverser::createSpvSpecConstant(const glslang::TIntermTyped& node)
{
assert(node.getQualifier().storage == glslang::EvqConst);
assert(node.getQualifier().isConstant());
if (! node.getQualifier().specConstant) {
// hand off to the non-spec-constant path