Implement 1.20 style function signature matching under implicit conversion. This was the last key unimplemented feature of versions 120 through 330.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23798 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-30 23:17:34 +00:00
parent 8cbd18ecaa
commit 0d22e31c75
36 changed files with 323 additions and 65 deletions

View file

@ -846,20 +846,30 @@ public:
// See if two types match, in all aspects except arrayness
bool sameElementType(const TType& right) const
{
return basicType == right.basicType &&
sampler == right.sampler &&
return basicType == right.basicType && sameElementShape(right);
}
// See if two type's arrayness match
bool sameArrayness(const TType& right) const
{
return ((arraySizes == 0 && right.arraySizes == 0) ||
(arraySizes && right.arraySizes && arraySizes->sizes == right.arraySizes->sizes));
}
// See if two type's elements match in all ways except basic type
bool sameElementShape(const TType& right) const
{
return sampler == right.sampler &&
vectorSize == right.vectorSize &&
matrixCols == right.matrixCols &&
matrixRows == right.matrixRows &&
sameStructType(right);
}
// See if two types match in all ways (just the actual type, not qualification
// See if two types match in all ways (just the actual type, not qualification)
bool operator==(const TType& right) const
{
return sameElementType(right) &&
((arraySizes == 0 && right.arraySizes == 0) ||
(arraySizes && right.arraySizes && arraySizes->sizes == right.arraySizes->sizes));
return sameElementType(right) && sameArrayness(right);
}
bool operator!=(const TType& right) const