// There is a 1:1 mapping between a spv builder and a module; this is thread safe
spv::Builder builder;
- bool inMain;
- bool mainTerminated;
+ bool inEntryPoint;
+ bool entryPointTerminated;
bool linkageOnly; // true when visiting the set of objects in the AST present only for establishing interface, whether or not they were statically used
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
const glslang::TIntermediate* glslangIntermediate;
: TIntermTraverser(true, false, true), shaderEntry(nullptr), currentFunction(nullptr),
sequenceDepth(0), logger(buildLogger),
builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger),
- inMain(false), mainTerminated(false), linkageOnly(false),
+ inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
glslangIntermediate(glslangIntermediate)
{
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
// Finish creating SPV, after the traversal is complete.
void TGlslangToSpvTraverser::finishSpv()
{
- if (! mainTerminated) {
+ if (! entryPointTerminated) {
builder.setBuildPoint(shaderEntry->getLastBlock());
builder.leaveFunction();
}
case glslang::EOpFunction:
if (visit == glslang::EvPreVisit) {
if (isShaderEntryPoint(node)) {
- inMain = true;
+ inEntryPoint = true;
builder.setBuildPoint(shaderEntry->getLastBlock());
currentFunction = shaderEntry;
} else {
handleFunctionEntry(node);
}
} else {
- if (inMain)
- mainTerminated = true;
+ if (inEntryPoint)
+ entryPointTerminated = true;
builder.leaveFunction();
- inMain = false;
+ inEntryPoint = false;
}
return true;
builderNumber(magicNumber),
buildPoint(0),
uniqueId(0),
- mainFunction(0),
+ entryPointFunction(0),
generatingOpCodeForSpecConst(false),
logger(buildLogger)
{
// Comments in header
Function* Builder::makeEntryPoint(const char* entryPoint)
{
- assert(! mainFunction);
+ assert(! entryPointFunction);
Block* entry;
std::vector<Id> params;
std::vector<Decoration> precisions;
- mainFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
+ entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry);
- return mainFunction;
+ return entryPointFunction;
}
// Comments in header
Module module;
Block* buildPoint;
Id uniqueId;
- Function* mainFunction;
+ Function* entryPointFunction;
bool generatingOpCodeForSpecConst;
AccessChain accessChain;
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
-#define GLSLANG_REVISION "Overload400-PrecQual.1659"
+#define GLSLANG_REVISION "Overload400-PrecQual.1660"
#define GLSLANG_DATE "26-Nov-2016"
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
contextPragma(true, false),
loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
- postMainReturn(false),
+ postEntryPointReturn(false),
limits(resources.limits),
entryPointOutput(nullptr),
nextInLocation(0), nextOutLocation(0)
intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc);
loopNestingLevel = 0;
controlFlowNestingLevel = 0;
- postMainReturn = false;
+ postEntryPointReturn = false;
// Handle function attributes
if (inEntryPoint) {
int controlFlowNestingLevel; // 0 if outside all flow control
TList<TIntermSequence*> switchSequenceStack; // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting
bool inEntryPoint; // if inside a function, true if the function is the entry point
- bool postMainReturn; // if inside a function, true if the function is the entry point and this is after a return statement
+ bool postEntryPointReturn; // if inside a function, true if the function is the entry point and this is after a return statement
const TType* currentFunctionType; // the return type of the function that's currently being parsed
bool functionReturnsValue; // true if a non-void function has a return
TBuiltInResource resources;