HLSL: struct splitting: assignments of hierarchical split types

This commit adds support for copying nested hierarchical types of split
types.  E.g, a struct of a struct containing both user and builtin interstage
IO variables.

When copying split types, if any subtree does NOT contain builtin interstage
IO, we can copy the whole subtree with one assignment, which saves a bunch
of AST verbosity for memberwise copies of that subtree.
This commit is contained in:
steve-lunarg 2016-12-19 15:48:01 -07:00
parent a2e7531057
commit 132d331870
19 changed files with 1113 additions and 234 deletions

View file

@ -1320,7 +1320,7 @@ public:
virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); }
// Return true if this is interstage IO
virtual bool isInterstageIO() const
virtual bool isBuiltInInterstageIO() const
{
switch (getQualifier().builtIn) {
case EbvPosition:
@ -1401,28 +1401,28 @@ public:
}
// Recursively checks if the type contains an interstage IO builtin
virtual bool containsInterstageIO() const
virtual bool containsBuiltInInterstageIO() const
{
if (isInterstageIO())
if (isBuiltInInterstageIO())
return true;
if (! structure)
return false;
for (unsigned int i = 0; i < structure->size(); ++i) {
if ((*structure)[i].type->containsInterstageIO())
if ((*structure)[i].type->containsBuiltInInterstageIO())
return true;
}
return false;
}
// Recursively checks whether a struct contains only interstage IO
virtual bool containsOnlyInterstageIO() const
virtual bool containsOnlyBuiltInInterstageIO() const
{
if (! structure)
return isInterstageIO();
return isBuiltInInterstageIO();
for (unsigned int i = 0; i < structure->size(); ++i) {
if (!(*structure)[i].type->containsOnlyInterstageIO())
if (!(*structure)[i].type->containsOnlyBuiltInInterstageIO())
return false;
}
return true;