specConstant = false;
}
- bool hasSemantic() const
- {
- return semanticName != nullptr;
- }
-
+ const char* semanticName;
TStorageQualifier storage : 6;
TBuiltInVariable builtIn : 8;
TPrecisionQualifier precision : 3;
// 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.1911"
++#define GLSLANG_REVISION "Overload400-PrecQual.1914"
#define GLSLANG_DATE "14-Mar-2017"
virtual void visitSymbol(TIntermSymbol* base)
{
- if (base->getType().getQualifier().isUniformOrBuffer()) {
- TVarLiveMap* target;
++ TVarLiveMap* target = nullptr;
+ if (base->getQualifier().storage == EvqVaryingIn)
+ target = &inputList;
+ else if (base->getQualifier().storage == EvqVaryingOut)
+ target = &outputList;
- else if (base->getType().getQualifier().isUniformOrBuffer())
++ else if (base->getQualifier().isUniformOrBuffer())
+ target = &uniformList;
- else
- target = nullptr;
++
+ if (target) {
TVarEntryInfo ent = { base->getId(), base, !traverseAll };
- TVarLiveMap::iterator at = std::lower_bound(varLiveList.begin(), varLiveList.end(), ent, TVarEntryInfo::TOrderById());
- if (at != varLiveList.end() && at->id == ent.id)
+ TVarLiveMap::iterator at = std::lower_bound(target->begin(), target->end(), ent, TVarEntryInfo::TOrderById());
+ if (at != target->end() && at->id == ent.id)
at->live = at->live || !traverseAll; // update live state
else
- varLiveList.insert(at, ent);
+ target->insert(at, ent);
}
}
virtual void visitSymbol(TIntermSymbol* base)
{
- else if (base->getQualifier().storage == EvqUniform)
+ const TVarLiveMap* source;
+ if (base->getQualifier().storage == EvqVaryingIn)
+ source = &inputList;
+ else if (base->getQualifier().storage == EvqVaryingOut)
+ source = &outputList;
++ else if (base->getQualifier().isUniformOrBuffer())
+ source = &uniformList;
+ else
+ return;
+
TVarEntryInfo ent = { base->getId() };
- TVarLiveMap::const_iterator at = std::lower_bound(varLiveList.begin(), varLiveList.end(), ent, TVarEntryInfo::TOrderById());
- if (at == varLiveList.end())
+ TVarLiveMap::const_iterator at = std::lower_bound(source->begin(), source->end(), ent, TVarEntryInfo::TOrderById());
+ if (at == source->end())
return;
- if (!(at->id == ent.id))
+
+ if (at->id != ent.id)
return;
if (at->newBinding != -1)
/*
* Basic implementation of glslang::TIoMapResolver that replaces the
-- * previous offset behaviour.
-- * It does the same, uses the offsets for th corresponding uniform
++ * previous offset behavior.
++ * It does the same, uses the offsets for the corresponding uniform
* types. Also respects the EOptionAutoMapBindings flag and binds
* them if needed.
*/
bool getGeoPassthroughEXT() const { return geoPassthroughEXT; }
#endif
- return semanticNameSet.insert(name).first->c_str();
+ const char* addSemanticName(const TString& name)
+ {
++ return semanticNameSet.insert(name).first->c_str();
+ }
+
protected:
TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
void error(TInfoSink& infoSink, const char*);
parseContext.handleRegister(registerDesc.loc, qualifier, profile.string, *registerDesc.string, subComponent, spaceDesc.string);
} else {
// semantic, in idToken.string
-- parseContext.handleSemantic(idToken.loc, qualifier, mapSemantic(*idToken.string));
++ TString semanticUpperCase = *idToken.string;
++ std::transform(semanticUpperCase.begin(), semanticUpperCase.end(), semanticUpperCase.begin(), ::toupper);
++ parseContext.handleSemantic(idToken.loc, qualifier, mapSemantic(semanticUpperCase.c_str()), semanticUpperCase);
}
} else if (peekTokenClass(EHTokLeftAngle)) {
found = true;
// Handle seeing a "COLON semantic" at the end of a type declaration,
// by updating the type according to the semantic.
//
--void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn)
++void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn, const TString& upperCase)
{
// adjust for stage in/out
}
qualifier.builtIn = builtIn;
- qualifier.semanticName = intermediate.addSemanticName(semanticUpperCase);
++ qualifier.semanticName = intermediate.addSemanticName(upperCase);
}
//
TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermOperator&);
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
-- void handleSemantic(TSourceLoc, TQualifier&, TBuiltInVariable);
++ void handleSemantic(TSourceLoc, TQualifier&, TBuiltInVariable, const TString& upperCase);
void handlePackOffset(const TSourceLoc&, TQualifier&, const glslang::TString& location,
const glslang::TString* component);
void handleRegister(const TSourceLoc&, TQualifier&, const glslang::TString* profile, const glslang::TString& desc,
token.tokenClass = tokenClass;
}
--glslang::TBuiltInVariable HlslScanContext::mapSemantic(const TString& semantic)
++glslang::TBuiltInVariable HlslScanContext::mapSemantic(const char* upperCase)
{
-- TString semanticUpperCase = semantic;
-- std::transform(semanticUpperCase.begin(), semanticUpperCase.end(), semanticUpperCase.begin(), ::toupper);
--
-- auto it = SemanticMap->find(semanticUpperCase.c_str());
++ auto it = SemanticMap->find(upperCase);
if (it != SemanticMap->end())
return it->second;
else
static void deleteKeywordMap();
void tokenize(HlslToken&);
-- glslang::TBuiltInVariable mapSemantic(const TString& semantic);
++ glslang::TBuiltInVariable mapSemantic(const char*);
protected:
HlslScanContext(HlslScanContext&);
bool acceptTokenClass(EHlslTokenClass);
EHlslTokenClass peek() const;
bool peekTokenClass(EHlslTokenClass) const;
-- glslang::TBuiltInVariable mapSemantic(const TString& semantic) { return scanner.mapSemantic(semantic); }
++ glslang::TBuiltInVariable mapSemantic(const char* upperCase) { return scanner.mapSemantic(upperCase); }
void pushTokenStream(const TVector<HlslToken>* tokens);
void popTokenStream();