SPV: Add capability ImageGatherExtended if necessary.
authorRex Xu <rex.xu@amd.com>
Wed, 11 May 2016 08:38:50 +0000 (16:38 +0800)
committerRex Xu <rex.xu@amd.com>
Wed, 11 May 2016 08:38:50 +0000 (16:38 +0800)
SPIRV/SpvBuilder.cpp
Test/baseResults/spv.400.frag.out
Test/baseResults/spv.420.geom.out

index 53410477867e49f244096b2b513a95a249e3519e..a08e54886194301144cbb43a5d5e04b64643c1e2 100644 (file)
@@ -1464,8 +1464,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
     if (parameters.offset) {
         if (isConstant(parameters.offset))
             mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetMask);
-        else
+        else {
+            addCapability(CapabilityImageGatherExtended);
             mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask);
+        }
         texArgs[numArgs++] = parameters.offset;
     }
     if (parameters.offsets) {
index 651d67dee010d6ba7b4553a88c175df1c0af7856..4af713c4351429c40d4a83634cbd8dd8caa93846 100644 (file)
@@ -11,6 +11,7 @@ Linked fragment stage:
 
                               Capability Shader
                               Capability Float64
+                              Capability ImageGatherExtended
                               Capability ClipDistance
                               Capability SampledRect
                1:             ExtInstImport  "GLSL.std.450"
index cb535599f100a694dafcb7d9f6a9d82f6352df3e..78e3aaa284735d4a021f32f3a832c9b85b8e5837 100644 (file)
@@ -11,6 +11,7 @@ Linked geometry stage:
 
                               Capability Geometry
                               Capability GeometryPointSize
+                              Capability ImageGatherExtended
                               Capability GeometryStreams
                               Capability MultiViewport
                1:             ExtInstImport  "GLSL.std.450"