ES check for vertex out or fragment in containing any of
• An array of arrays • An array of structures • A structure containing an array • A structure containing a structure git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28745 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
ad54b24fba
commit
b07957cf22
9 changed files with 163 additions and 6 deletions
|
|
@ -2077,6 +2077,10 @@ void TParseContext::globalQualifierTypeCheck(TSourceLoc loc, const TQualifier& q
|
|||
if (publicType.userDef) {
|
||||
profileRequires(loc, EEsProfile, 300, 0, "fragment-shader struct input");
|
||||
profileRequires(loc, ~EEsProfile, 150, 0, "fragment-shader struct input");
|
||||
if (publicType.userDef->containsStructure())
|
||||
requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing structure");
|
||||
if (publicType.userDef->containsArray())
|
||||
requireProfile(loc, ~EEsProfile, "fragment-shader struct input containing an array");
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -2095,7 +2099,12 @@ void TParseContext::globalQualifierTypeCheck(TSourceLoc loc, const TQualifier& q
|
|||
if (publicType.userDef) {
|
||||
profileRequires(loc, EEsProfile, 300, 0, "vertex-shader struct output");
|
||||
profileRequires(loc, ~EEsProfile, 150, 0, "vertex-shader struct output");
|
||||
if (publicType.userDef->containsStructure())
|
||||
requireProfile(loc, ~EEsProfile, "vertex-shader struct output containing structure");
|
||||
if (publicType.userDef->containsArray())
|
||||
requireProfile(loc, ~EEsProfile, "vertex-shader struct output containing an array");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EShLangTessControl:
|
||||
|
|
@ -2347,6 +2356,30 @@ bool TParseContext::arrayQualifierError(TSourceLoc loc, const TQualifier& qualif
|
|||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// See if this qualifier and type combination can be an array.
|
||||
// Assumes arrayQualifierError() was also called to catch the type-invariant tests.
|
||||
//
|
||||
// Returns true if there is an error.
|
||||
//
|
||||
bool TParseContext::arrayError(TSourceLoc loc, const TType& type)
|
||||
{
|
||||
if (type.getQualifier().storage == EvqVaryingOut && language == EShLangVertex) {
|
||||
if (type.isArrayOfArrays())
|
||||
requireProfile(loc, ~EEsProfile, "vertex-shader array-of-array output");
|
||||
else if (type.getArraySize() && type.isStruct())
|
||||
requireProfile(loc, ~EEsProfile, "vertex-shader array-of-struct output");
|
||||
}
|
||||
if (type.getQualifier().storage == EvqVaryingIn && language == EShLangFragment) {
|
||||
if (type.isArrayOfArrays())
|
||||
requireProfile(loc, ~EEsProfile, "fragment-shader array-of-array input");
|
||||
else if (type.getArraySize() && type.isStruct())
|
||||
requireProfile(loc, ~EEsProfile, "fragment-shader array-of-struct input");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Require array to have size
|
||||
//
|
||||
|
|
@ -3932,7 +3965,7 @@ TIntermNode* TParseContext::declareVariable(TSourceLoc loc, TString& identifier,
|
|||
if (profile == EEsProfile && ! initializer)
|
||||
arraySizeRequiredCheck(loc, type.getArraySize());
|
||||
|
||||
if (! arrayQualifierError(loc, type.getQualifier()))
|
||||
if (! arrayQualifierError(loc, type.getQualifier()) && ! arrayError(loc, type))
|
||||
declareArray(loc, identifier, type, symbol, newDeclaration);
|
||||
|
||||
if (initializer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue