gallivm: do texture swizzle after shadow compare
authorBrian Paul <brianp@vmware.com>
Tue, 14 Dec 2010 17:38:15 +0000 (10:38 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 14 Dec 2010 19:17:10 +0000 (12:17 -0700)
We need to swizzle after the shadow comparison so that the GL_DEPTH_MODE
functionality is handled properly.

This fixes all the piglit glsl-fs-shadow2d*.shader_test cases, except
for glsl-fs-shadow2dproj-bias.shader_test which fails because of a
bug in the GLSL compiler (fd.o 32395).

src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 991f6fa5ef7bdf45a6fa43761545fefaf4ef0909..e61cf9541ea9cb50fd8c28f1939606c912ab3296 100644 (file)
@@ -1098,6 +1098,4 @@ lp_build_sample_aos(struct lp_build_sample_context *bld,
       texel_out[2] = unswizzled[2];
       texel_out[3] = unswizzled[3];
    }
-
-   apply_sampler_swizzle(bld, texel_out);
 }
index cf46e2be83269fb98307a49ed4af5084f122fb60..e685f4b73f0ce7775ea42233ed2a2d4cce717990 100644 (file)
@@ -187,8 +187,6 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld,
                                            border_chan_vec, texel_out[chan]);
       }
    }
-
-   apply_sampler_swizzle(bld, texel_out);
 }
 
 
@@ -1268,4 +1266,6 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
    }
 
    lp_build_sample_compare(&bld, r, texel_out);
+
+   apply_sampler_swizzle(&bld, texel_out);
 }