GLSL: Fix #1591: Require the id in subgroupBroadcast to be constant.
This commit is contained in:
@@ -1998,6 +1998,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
case EOpSubgroupClusteredAnd:
|
||||
case EOpSubgroupClusteredOr:
|
||||
case EOpSubgroupClusteredXor:
|
||||
// The <clusterSize> as used in the subgroupClustered<op>() operations must be:
|
||||
// - An integral constant expression.
|
||||
// - At least 1.
|
||||
// - A power of 2.
|
||||
if ((*argp)[1]->getAsConstantUnion() == nullptr)
|
||||
error(loc, "argument must be compile-time constant", "cluster size", "");
|
||||
else {
|
||||
@@ -2009,6 +2013,12 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
}
|
||||
break;
|
||||
|
||||
case EOpSubgroupBroadcast:
|
||||
// <id> must be an integral constant expression.
|
||||
if ((*argp)[1]->getAsConstantUnion() == nullptr)
|
||||
error(loc, "argument must be compile-time constant", "id", "");
|
||||
break;
|
||||
|
||||
case EOpBarrier:
|
||||
case EOpMemoryBarrier:
|
||||
if (argp->size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user