OSDN Git Service

gallivm: fix rho calculation for 1d case
authorRoland Scheidegger <sroland@vmware.com>
Wed, 21 Aug 2013 14:54:58 +0000 (16:54 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 21 Aug 2013 20:05:52 +0000 (22:05 +0200)
Was using wrong (undefined) vector element (the elements are at 0/2 position,
not 0/1).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_sample.c

index 8c5189d..d339aba 100644 (file)
@@ -395,7 +395,7 @@ lp_build_rho(struct lp_build_sample_context *bld,
 
          if (dims < 2) {
             rho_xvec = lp_build_swizzle_aos(coord_bld, ddx_ddy[0], swizzle0);
-            rho_yvec = lp_build_swizzle_aos(coord_bld, ddx_ddy[0], swizzle1);
+            rho_yvec = lp_build_swizzle_aos(coord_bld, ddx_ddy[0], swizzle2);
          }
          else if (dims == 2) {
             static const unsigned char swizzle02[] = {