From 6feb4989fe77da338abb49b4b2d3e28197b6dd79 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Sun, 13 Dec 2015 12:23:33 -0700 Subject: [PATCH] SPV texturing: Use comp. 2 as the 3rd comp. for Dref in ImageSampleProjDrefImplicitLod. --- SPIRV/GlslangToSpv.cpp | 2 +- Test/baseResults/spv.400.frag.out | 2 +- Test/baseResults/spv.texture.frag.out | 8 ++++---- Test/baseResults/spv.texture.vert.out | 4 ++-- glslang/Include/revision.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 3d589bd..78e9e6d 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1951,7 +1951,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO std::vector indexes; int comp; if (cracked.proj) - comp = 3; + comp = 2; // "The resulting 3rd component of P in the shadow forms is used as Dref" else comp = builder.getNumComponents(params.coords) - 1; indexes.push_back(comp); diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index ffd1299..1ed59c7 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -163,7 +163,7 @@ Linked fragment stage: 7: Label 16: 13 Load 15(u2drs) 17: 9(fvec4) Load 11(outp) - 26: 8(float) CompositeExtract 17 3 + 26: 8(float) CompositeExtract 17 2 27: 8(float) ImageSampleProjDrefExplicitLod 16 17 26 Grad ConstOffset 20 20 25 31: 30(ptr) AccessChain 11(outp) 29 32: 8(float) Load 31 diff --git a/Test/baseResults/spv.texture.frag.out b/Test/baseResults/spv.texture.frag.out index b9c29d3..cbbd0c4 100755 --- a/Test/baseResults/spv.texture.frag.out +++ b/Test/baseResults/spv.texture.frag.out @@ -268,7 +268,7 @@ Linked fragment stage: Store 26(color) 173 174: 137 Load 139(shadowSampler1D) 175: 22(fvec4) Load 24(coords4D) - 176: 6(float) CompositeExtract 175 3 + 176: 6(float) CompositeExtract 175 2 177: 6(float) ImageSampleProjDrefImplicitLod 174 175 176 178: 22(fvec4) Load 26(color) 179: 22(fvec4) CompositeConstruct 177 177 177 177 @@ -277,7 +277,7 @@ Linked fragment stage: 181: 137 Load 139(shadowSampler1D) 182: 22(fvec4) Load 24(coords4D) 183: 6(float) Load 10(bias) - 184: 6(float) CompositeExtract 182 3 + 184: 6(float) CompositeExtract 182 2 185: 6(float) ImageSampleProjDrefImplicitLod 181 182 184 Bias 183 186: 22(fvec4) Load 26(color) 187: 22(fvec4) CompositeConstruct 185 185 185 185 @@ -285,7 +285,7 @@ Linked fragment stage: Store 26(color) 188 189: 156 Load 158(shadowSampler2D) 190: 22(fvec4) Load 24(coords4D) - 191: 6(float) CompositeExtract 190 3 + 191: 6(float) CompositeExtract 190 2 192: 6(float) ImageSampleProjDrefImplicitLod 189 190 191 193: 22(fvec4) Load 26(color) 194: 22(fvec4) CompositeConstruct 192 192 192 192 @@ -294,7 +294,7 @@ Linked fragment stage: 196: 156 Load 158(shadowSampler2D) 197: 22(fvec4) Load 24(coords4D) 198: 6(float) Load 10(bias) - 199: 6(float) CompositeExtract 197 3 + 199: 6(float) CompositeExtract 197 2 200: 6(float) ImageSampleProjDrefImplicitLod 196 197 199 Bias 198 201: 22(fvec4) Load 26(color) 202: 22(fvec4) CompositeConstruct 200 200 200 200 diff --git a/Test/baseResults/spv.texture.vert.out b/Test/baseResults/spv.texture.vert.out index 95090b8..7d4a2db 100755 --- a/Test/baseResults/spv.texture.vert.out +++ b/Test/baseResults/spv.texture.vert.out @@ -174,7 +174,7 @@ Linked vertex stage: 123: 100 Load 102(shadowSampler1D) 124: 18(fvec4) Load 20(coords4D) 125: 6(float) Load 8(lod) - 126: 6(float) CompositeExtract 124 3 + 126: 6(float) CompositeExtract 124 2 127: 6(float) ImageSampleProjDrefExplicitLod 123 124 126 Lod 125 128: 18(fvec4) Load 23(color) 129: 18(fvec4) CompositeConstruct 127 127 127 127 @@ -183,7 +183,7 @@ Linked vertex stage: 131: 112 Load 114(shadowSampler2D) 132: 18(fvec4) Load 20(coords4D) 133: 6(float) Load 8(lod) - 134: 6(float) CompositeExtract 132 3 + 134: 6(float) CompositeExtract 132 2 135: 6(float) ImageSampleProjDrefExplicitLod 131 132 134 Lod 133 136: 18(fvec4) Load 23(color) 137: 18(fvec4) CompositeConstruct 135 135 135 135 diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 55eced3..ccef7b9 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "SPIRV99.843" +#define GLSLANG_REVISION "SPIRV99.844" #define GLSLANG_DATE "13-Dec-2015" -- 2.7.4