From 5839031759546805bcf6dfa81a0e869cd07906f9 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Wed, 11 May 2016 16:38:50 +0800 Subject: [PATCH] SPV: Add capability ImageGatherExtended if necessary. --- SPIRV/SpvBuilder.cpp | 4 +++- Test/baseResults/spv.400.frag.out | 1 + Test/baseResults/spv.420.geom.out | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 53410477..a08e5488 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -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) { diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 651d67de..4af713c4 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -11,6 +11,7 @@ Linked fragment stage: Capability Shader Capability Float64 + Capability ImageGatherExtended Capability ClipDistance Capability SampledRect 1: ExtInstImport "GLSL.std.450" diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out index cb535599..78e3aaa2 100644 --- a/Test/baseResults/spv.420.geom.out +++ b/Test/baseResults/spv.420.geom.out @@ -11,6 +11,7 @@ Linked geometry stage: Capability Geometry Capability GeometryPointSize + Capability ImageGatherExtended Capability GeometryStreams Capability MultiViewport 1: ExtInstImport "GLSL.std.450"