Merge branch 'amdrexu-bugfix'

This commit is contained in:
John Kessenich 2018-03-07 14:26:08 -07:00
commit 45422f1851
2 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,3 @@
// This header is generated by the make-revision script.
#define GLSLANG_PATCH_LEVEL 2599
#define GLSLANG_PATCH_LEVEL 2601

View File

@ -1494,6 +1494,39 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
requireExtensions(loc, 1, &E_GL_ARB_sparse_texture2, fnCandidate.getName().c_str());
break;
}
case EOpSwizzleInvocations:
{
if (! (*argp)[1]->getAsConstantUnion())
error(loc, "argument must be compile-time constant", "offset", "");
else {
unsigned offset[4] = {};
offset[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst();
offset[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst();
offset[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst();
offset[3] = (*argp)[1]->getAsConstantUnion()->getConstArray()[3].getUConst();
if (offset[0] > 3 || offset[1] > 3 || offset[2] > 3 || offset[3] > 3)
error(loc, "components must be in the range [0, 3]", "offset", "");
}
break;
}
case EOpSwizzleInvocationsMasked:
{
if (! (*argp)[1]->getAsConstantUnion())
error(loc, "argument must be compile-time constant", "mask", "");
else {
unsigned mask[3] = {};
mask[0] = (*argp)[1]->getAsConstantUnion()->getConstArray()[0].getUConst();
mask[1] = (*argp)[1]->getAsConstantUnion()->getConstArray()[1].getUConst();
mask[2] = (*argp)[1]->getAsConstantUnion()->getConstArray()[2].getUConst();
if (mask[0] > 31 || mask[1] > 31 || mask[2] > 31)
error(loc, "components must be in the range [0, 31]", "mask", "");
}
break;
}
#endif
case EOpTextureOffset: