Non-functional: Rename some entry-point variables to entryPoint, not main.
This commit is contained in:
parent
fca826212c
commit
517fe7a6ad
6 changed files with 17 additions and 17 deletions
|
|
@ -182,8 +182,8 @@ protected:
|
||||||
|
|
||||||
// There is a 1:1 mapping between a spv builder and a module; this is thread safe
|
// There is a 1:1 mapping between a spv builder and a module; this is thread safe
|
||||||
spv::Builder builder;
|
spv::Builder builder;
|
||||||
bool inMain;
|
bool inEntryPoint;
|
||||||
bool mainTerminated;
|
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
|
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
|
std::set<spv::Id> iOSet; // all input/output variables from either static use or declaration of interface
|
||||||
const glslang::TIntermediate* glslangIntermediate;
|
const glslang::TIntermediate* glslangIntermediate;
|
||||||
|
|
@ -769,7 +769,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
||||||
: TIntermTraverser(true, false, true), shaderEntry(nullptr), currentFunction(nullptr),
|
: TIntermTraverser(true, false, true), shaderEntry(nullptr), currentFunction(nullptr),
|
||||||
sequenceDepth(0), logger(buildLogger),
|
sequenceDepth(0), logger(buildLogger),
|
||||||
builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger),
|
builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger),
|
||||||
inMain(false), mainTerminated(false), linkageOnly(false),
|
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
|
||||||
glslangIntermediate(glslangIntermediate)
|
glslangIntermediate(glslangIntermediate)
|
||||||
{
|
{
|
||||||
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
|
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
|
||||||
|
|
@ -902,7 +902,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
||||||
// Finish creating SPV, after the traversal is complete.
|
// Finish creating SPV, after the traversal is complete.
|
||||||
void TGlslangToSpvTraverser::finishSpv()
|
void TGlslangToSpvTraverser::finishSpv()
|
||||||
{
|
{
|
||||||
if (! mainTerminated) {
|
if (! entryPointTerminated) {
|
||||||
builder.setBuildPoint(shaderEntry->getLastBlock());
|
builder.setBuildPoint(shaderEntry->getLastBlock());
|
||||||
builder.leaveFunction();
|
builder.leaveFunction();
|
||||||
}
|
}
|
||||||
|
|
@ -1383,17 +1383,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||||
case glslang::EOpFunction:
|
case glslang::EOpFunction:
|
||||||
if (visit == glslang::EvPreVisit) {
|
if (visit == glslang::EvPreVisit) {
|
||||||
if (isShaderEntryPoint(node)) {
|
if (isShaderEntryPoint(node)) {
|
||||||
inMain = true;
|
inEntryPoint = true;
|
||||||
builder.setBuildPoint(shaderEntry->getLastBlock());
|
builder.setBuildPoint(shaderEntry->getLastBlock());
|
||||||
currentFunction = shaderEntry;
|
currentFunction = shaderEntry;
|
||||||
} else {
|
} else {
|
||||||
handleFunctionEntry(node);
|
handleFunctionEntry(node);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (inMain)
|
if (inEntryPoint)
|
||||||
mainTerminated = true;
|
entryPointTerminated = true;
|
||||||
builder.leaveFunction();
|
builder.leaveFunction();
|
||||||
inMain = false;
|
inEntryPoint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Builder::Builder(unsigned int magicNumber, SpvBuildLogger* buildLogger) :
|
||||||
builderNumber(magicNumber),
|
builderNumber(magicNumber),
|
||||||
buildPoint(0),
|
buildPoint(0),
|
||||||
uniqueId(0),
|
uniqueId(0),
|
||||||
mainFunction(0),
|
entryPointFunction(0),
|
||||||
generatingOpCodeForSpecConst(false),
|
generatingOpCodeForSpecConst(false),
|
||||||
logger(buildLogger)
|
logger(buildLogger)
|
||||||
{
|
{
|
||||||
|
|
@ -967,15 +967,15 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat
|
||||||
// Comments in header
|
// Comments in header
|
||||||
Function* Builder::makeEntryPoint(const char* entryPoint)
|
Function* Builder::makeEntryPoint(const char* entryPoint)
|
||||||
{
|
{
|
||||||
assert(! mainFunction);
|
assert(! entryPointFunction);
|
||||||
|
|
||||||
Block* entry;
|
Block* entry;
|
||||||
std::vector<Id> params;
|
std::vector<Id> params;
|
||||||
std::vector<Decoration> precisions;
|
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
|
// Comments in header
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,7 @@ public:
|
||||||
Module module;
|
Module module;
|
||||||
Block* buildPoint;
|
Block* buildPoint;
|
||||||
Id uniqueId;
|
Id uniqueId;
|
||||||
Function* mainFunction;
|
Function* entryPointFunction;
|
||||||
bool generatingOpCodeForSpecConst;
|
bool generatingOpCodeForSpecConst;
|
||||||
AccessChain accessChain;
|
AccessChain accessChain;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
// For the version, it uses the latest git tag followed by the number of commits.
|
// 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).
|
// 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"
|
#define GLSLANG_DATE "26-Nov-2016"
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
|
||||||
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
|
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
|
||||||
contextPragma(true, false),
|
contextPragma(true, false),
|
||||||
loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
|
loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
|
||||||
postMainReturn(false),
|
postEntryPointReturn(false),
|
||||||
limits(resources.limits),
|
limits(resources.limits),
|
||||||
entryPointOutput(nullptr),
|
entryPointOutput(nullptr),
|
||||||
nextInLocation(0), nextOutLocation(0)
|
nextInLocation(0), nextOutLocation(0)
|
||||||
|
|
@ -1141,7 +1141,7 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
|
||||||
intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc);
|
intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc);
|
||||||
loopNestingLevel = 0;
|
loopNestingLevel = 0;
|
||||||
controlFlowNestingLevel = 0;
|
controlFlowNestingLevel = 0;
|
||||||
postMainReturn = false;
|
postEntryPointReturn = false;
|
||||||
|
|
||||||
// Handle function attributes
|
// Handle function attributes
|
||||||
if (inEntryPoint) {
|
if (inEntryPoint) {
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ protected:
|
||||||
int controlFlowNestingLevel; // 0 if outside all flow control
|
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
|
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 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
|
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
|
bool functionReturnsValue; // true if a non-void function has a return
|
||||||
TBuiltInResource resources;
|
TBuiltInResource resources;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue