HLSL: Build IO types bottom up, as parsed, and cache the original (IO).

Previously, this was done recursively, per object, and the nonIO version
was cached. This reverses both those approaches.
This commit is contained in:
John Kessenich 2017-02-03 17:57:55 -07:00
parent 88c4464df5
commit 727b374fd3
7 changed files with 295 additions and 324 deletions

View file

@ -412,7 +412,7 @@ public:
}
// Remove IO related data from qualifier.
void makeNonIo()
void makeNonIo() //?? remove?
{
// This preserves the storage type
builtIn = EbvNone;
@ -429,7 +429,7 @@ public:
}
// Return true if there is data which would be scrubbed by makeNonIo
bool hasIoData() const
bool hasIoData() const // ?? remove?
{
return builtIn != EbvNone ||
hasLayout() ||
@ -626,7 +626,6 @@ public:
{
return hasUniformLayout() ||
hasAnyLocation() ||
hasBinding() ||
hasStream() ||
hasXfb() ||
hasFormat() ||
@ -1221,34 +1220,10 @@ public:
// Make complete copy of the whole type graph rooted at 'copyOf'.
void deepCopy(const TType& copyOf)
{
TMap<TTypeList*,TTypeList*> copied; // to enable copying a type graph as a graph, not a tree
TMap<TTypeList*,TTypeList*> copied; // to enable copying a type graph as a graph, not a tree //?? turn off again?
deepCopy(copyOf, copied);
}
// Return true if type (recursively) contains IO data.
bool hasIoData() const
{
if (getQualifier().hasIoData())
return true;
if (isStruct())
for (unsigned int i = 0; i < structure->size(); ++i)
if ((*structure)[i].type->hasIoData())
return true;
return false;
}
// Remove IO related data from type
void makeNonIo()
{
getQualifier().makeNonIo();
if (isStruct())
for (unsigned int i = 0; i < structure->size(); ++i)
(*structure)[i].type->makeNonIo();
}
// Recursively make temporary
void makeTemporary()
{

View file

@ -2,5 +2,5 @@
// 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.1787"
#define GLSLANG_DATE "03-Feb-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.1791"
#define GLSLANG_DATE "04-Feb-2017"