SPV texturing: Use comp. 2 as the 3rd comp. for Dref in ImageSampleProjDrefImplicitLod.
authorJohn Kessenich <cepheus@frii.com>
Sun, 13 Dec 2015 19:23:33 +0000 (12:23 -0700)
committerJohn Kessenich <cepheus@frii.com>
Sun, 13 Dec 2015 19:23:33 +0000 (12:23 -0700)
SPIRV/GlslangToSpv.cpp
Test/baseResults/spv.400.frag.out
Test/baseResults/spv.texture.frag.out
Test/baseResults/spv.texture.vert.out
glslang/Include/revision.h

index 3d589bd..78e9e6d 100755 (executable)
@@ -1951,7 +1951,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
         std::vector<spv::Id> 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);
index ffd1299..1ed59c7 100644 (file)
@@ -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
index b9c29d3..cbbd0c4 100755 (executable)
@@ -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
index 95090b8..7d4a2db 100755 (executable)
@@ -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
index 55eced3..ccef7b9 100644 (file)
@@ -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"