Merge pull request #664 from steve-lunarg/stage-io-fix

add other builtins to interstage IO
This commit is contained in:
John Kessenich 2017-01-12 10:18:23 -07:00 committed by GitHub
commit e86fc0946f
16 changed files with 519 additions and 196 deletions

View file

@ -1319,9 +1319,18 @@ public:
virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); }
virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); }
// Return true if this is interstage IO
virtual bool isBuiltInInterstageIO() const
virtual bool isBuiltInInterstageIO(EShLanguage language) const
{
return isPerVertexAndBuiltIn(language) || isLooseAndBuiltIn(language);
}
// Return true if this is an interstage IO builtin
virtual bool isPerVertexAndBuiltIn(EShLanguage language) const
{
if (language == EShLangFragment)
return false;
// Any non-fragment stage
switch (getQualifier().builtIn) {
case EbvPosition:
case EbvPointSize:
@ -1333,6 +1342,15 @@ public:
}
}
// Return true if this is a loose builtin
virtual bool isLooseAndBuiltIn(EShLanguage language) const
{
if (getQualifier().builtIn == EbvNone)
return false;
return !isPerVertexAndBuiltIn(language);
}
// Recursively checks if the type contains the given basic type
virtual bool containsBasicType(TBasicType checkType) const
{
@ -1401,33 +1419,20 @@ public:
}
// Recursively checks if the type contains an interstage IO builtin
virtual bool containsBuiltInInterstageIO() const
virtual bool containsBuiltInInterstageIO(EShLanguage language) const
{
if (isBuiltInInterstageIO())
if (isBuiltInInterstageIO(language))
return true;
if (! structure)
return false;
for (unsigned int i = 0; i < structure->size(); ++i) {
if ((*structure)[i].type->containsBuiltInInterstageIO())
if ((*structure)[i].type->containsBuiltInInterstageIO(language))
return true;
}
return false;
}
// Recursively checks whether a struct contains only interstage IO
virtual bool containsOnlyBuiltInInterstageIO() const
{
if (! structure)
return isBuiltInInterstageIO();
for (unsigned int i = 0; i < structure->size(); ++i) {
if (!(*structure)[i].type->containsOnlyBuiltInInterstageIO())
return false;
}
return true;
}
virtual bool containsNonOpaque() const
{
// list all non-opaque types