Web: Use isEsProfile() instead of run-time testing; remove more atomics

Saves 2.5K, and design is better.
This commit is contained in:
John Kessenich
2019-08-09 03:49:15 -06:00
parent 155d351f86
commit fb4f2333da
17 changed files with 168 additions and 154 deletions

View File

@@ -2075,6 +2075,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
spv::Builder::AccessChain::CoherentFlags lvalueCoherentFlags;
#ifndef GLSLANG_WEB
if (node->getOp() == glslang::EOpAtomicCounterIncrement ||
node->getOp() == glslang::EOpAtomicCounterDecrement ||
node->getOp() == glslang::EOpAtomicCounter ||
@@ -2083,7 +2084,10 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType());
} else
#endif
{
operand = accessChainLoad(node->getOperand()->getType());
}
OpDecorations decorations = { TranslatePrecisionDecoration(node->getOperationPrecision()),
TranslateNoContractionDecoration(node->getType().getQualifier()),