Fix a parse issue of imageAtomicCompSwap()

The max count of arguments is 5 when image2DMS/image2DMSArray is
specified.
This commit is contained in:
Rex Xu 2018-10-17 13:55:11 +08:00
parent e9405d0b44
commit d698ebf5f8
3 changed files with 64 additions and 32 deletions

View file

@ -1897,7 +1897,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), "");
}
if (argp->size() > 4) {
const size_t maxArgs = imageType.getSampler().isMultiSample() ? 5 : 4;
if (argp->size() > maxArgs) {
requireExtensions(loc, 1, &E_GL_KHR_memory_scope_semantics, fnCandidate.getName().c_str());
memorySemanticsCheck(loc, fnCandidate, callNode);
}