Add missing matrix constructor test, and add a size() method for downstream consumers of constArrays.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26937 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -445,6 +445,7 @@ public:
|
||||
unionArray = new TConstUnionVector(size, val);
|
||||
}
|
||||
|
||||
int size() const { return unionArray ? (int)unionArray->size() : 0; }
|
||||
TConstUnion& operator[](size_t index) { return (*unionArray)[index]; }
|
||||
const TConstUnion& operator[](size_t index) const { return (*unionArray)[index]; }
|
||||
bool operator==(const TConstUnionArray& rhs) const
|
||||
|
||||
@@ -1698,9 +1698,9 @@ bool TParseContext::builtInName(const TString& identifier)
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure there is enough data provided to the constructor to build
|
||||
// something of the type of the constructor. Also returns the type of
|
||||
// the constructor.
|
||||
// Make sure there is enough data and not too many arguments provided to the
|
||||
// constructor to build something of the type of the constructor. Also returns
|
||||
// the type of the constructor.
|
||||
//
|
||||
// Returns true if there was an error in construction.
|
||||
//
|
||||
@@ -1781,6 +1781,11 @@ bool TParseContext::constructorError(TSourceLoc loc, TIntermNode* node, TFunctio
|
||||
|
||||
if (matrixInMatrix && ! type.isArray()) {
|
||||
profileRequires(loc, ENoProfile, 120, 0, "constructing matrix from matrix");
|
||||
|
||||
// "If a matrix argument is given to a matrix constructor,
|
||||
// it is a compile-time error to have any other arguments."
|
||||
if (function.getParamCount() > 1)
|
||||
error(loc, "matrix constructed from matrix can only have one argument", "constructor", "");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user