summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_depth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_depth.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_depth.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index 09b82fbe9b..6b8ffb6ca2 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
@@ -462,7 +462,8 @@ lp_build_depth_stencil_test(LLVMBuilderRef builder,
LLVMValueRef z_src,
LLVMValueRef zs_dst_ptr,
LLVMValueRef face,
- LLVMValueRef counter)
+ LLVMValueRef counter,
+ boolean do_branch)
{
struct lp_type type;
struct lp_build_context bld;
@@ -515,6 +516,9 @@ lp_build_depth_stencil_test(LLVMBuilderRef builder,
lp_build_mask_update(mask, z_pass);
+ if (do_branch)
+ lp_build_mask_check(mask);
+
/* No need to worry about old stencil contents, just blend the
* old and new values and shift into the correct position for
* storage.
@@ -701,6 +705,11 @@ lp_build_depth_stencil_test(LLVMBuilderRef builder,
* buffer values. Don't need to update Z buffer values.
*/
lp_build_mask_update(mask, z_pass);
+
+ if (do_branch) {
+ lp_build_mask_check(mask);
+ do_branch = FALSE;
+ }
}
if (depth->writemask) {
@@ -779,6 +788,9 @@ lp_build_depth_stencil_test(LLVMBuilderRef builder,
if (depth->enabled && stencil[0].enabled)
lp_build_mask_update(mask, z_pass);
+ if (do_branch)
+ lp_build_mask_check(mask);
+
if (counter)
lp_build_occlusion_count(builder, type, mask->value, counter);
}