Mesa (master): llvmpipe: (trivial) remove confusing code in stencil test

Roland Scheidegger sroland at kemper.freedesktop.org
Wed May 22 20:57:42 UTC 2013


Module: Mesa
Branch: master
Commit: 3c91ef0f297d7dd619c02c03b01a6d99c018ad8d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c91ef0f297d7dd619c02c03b01a6d99c018ad8d

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Tue May 21 23:10:53 2013 +0200

llvmpipe: (trivial) remove confusing code in stencil test

This was meant to disable some code which isn't needed when depth/stencil
isn't written. However, there's more code which wouldn't be needed in that
case so having the condition there was just odd (llvm will drop all the code
anyway).

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/drivers/llvmpipe/lp_bld_depth.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index 08138f0..5ef9947 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
@@ -1097,23 +1097,18 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
                                   stencil_shift, "");
 
    /* Finally, merge the z/stencil values */
-   if ((depth->enabled && depth->writemask) ||
-       (stencil[0].enabled && (stencil[0].writemask ||
-                               (stencil[1].enabled && stencil[1].writemask)))) {
-
-      if (format_desc->block.bits <= 32) {
-         if (have_z && have_s)
-            *z_value = LLVMBuildOr(builder, z_dst, stencil_vals, "");
-         else if (have_z)
-            *z_value = z_dst;
-         else
-            *z_value = stencil_vals;
-         *s_value = *z_value;
-      }
-      else {
+   if (format_desc->block.bits <= 32) {
+      if (have_z && have_s)
+         *z_value = LLVMBuildOr(builder, z_dst, stencil_vals, "");
+      else if (have_z)
          *z_value = z_dst;
-         *s_value = stencil_vals;
-      }
+      else
+         *z_value = stencil_vals;
+      *s_value = *z_value;
+   }
+   else {
+      *z_value = z_dst;
+      *s_value = stencil_vals;
    }
 
    if (s_pass_mask)




More information about the mesa-commit mailing list