gallivm: Fix calculating rho for 3d textures for the single-quad case
authorRoland Scheidegger <sroland@vmware.com>
Thu, 24 May 2012 19:05:13 +0000 (21:05 +0200)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 8 Jun 2012 16:46:57 +0000 (17:46 +0100)
Discovered by accident, this looks like a very old typo bug.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_sample.c

index 2ffd9b8bfc361dfaa0785a6c8e1286d31b37d070..d966788d74e9237ad67edca30275281abd9bddef 100644 (file)
@@ -256,9 +256,8 @@ lp_build_rho(struct lp_build_sample_context *bld,
          rho_t = LLVMBuildExtractElement(builder, rho_vec, index1, "");
 
          rho = lp_build_max(float_bld, rho_s, rho_t);
-
          if (dims >= 3) {
-            rho_r = LLVMBuildExtractElement(builder, rho_vec, index0, "");
+            rho_r = LLVMBuildExtractElement(builder, rho_vec, index2, "");
             rho = lp_build_max(float_bld, rho, rho_r);
          }
       }