GLSL: Only require constant for subgroupBroadcast when SPV < 1.5.
authorJohn Kessenich <cepheus@frii.com>
Wed, 28 Aug 2019 06:01:54 +0000 (00:01 -0600)
committerJohn Kessenich <cepheus@frii.com>
Mon, 16 Sep 2019 13:16:41 +0000 (07:16 -0600)
glslang/MachineIndependent/ParseHelper.cpp

index 08fa610..e8177d3 100644 (file)
@@ -2155,9 +2155,11 @@ 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", "");
+        if (spvVersion.spv < EShTargetSpv_1_5) {
+            // <id> must be an integral constant expression.
+            if ((*argp)[1]->getAsConstantUnion() == nullptr)
+                error(loc, "argument must be compile-time constant", "id", "");
+        }
         break;
 
     case EOpBarrier: