For bug #2580: sparseTextureGatherOffsetsARB should only take constant offsets.

This commit is contained in:
Pankaj Mistry 2021-03-24 12:52:23 -07:00
parent 2c7c84c8ac
commit 18cfc3f106
7 changed files with 2440 additions and 2300 deletions

View file

@ -2096,7 +2096,13 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
profileRequires(loc, ~EEsProfile, 450, nullptr, feature);
requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature);
}
// As per GL_ARB_sparse_texture2 extension "Offsets" parameter must be constant integral expression
// for sparseTextureGatherOffsetsARB just as textureGatherOffsets
if (callNode.getOp() == EOpSparseTextureGatherOffsets) {
int offsetsArg = arg0->getType().getSampler().shadow ? 3 : 2;
if (!(*argp)[offsetsArg]->getAsConstantUnion())
error(loc, "argument must be compile-time constant", "offsets", "");
}
break;
}