summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_depth.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index 5ef99473e4d..df6a6c41bbf 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
@@ -1116,9 +1116,5 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
if (depth->enabled && stencil[0].enabled)
lp_build_mask_update(mask, z_pass);
-
- if (do_branch)
- lp_build_mask_check(mask);
-
}
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 1dfc75a42dc..754288ba0e2 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -361,6 +361,13 @@ generate_fs_loop(struct gallivm_state *gallivm,
depth_ptr, depth_stride,
z_value, s_value);
}
+ /*
+ * Note mask check if stencil is enabled must be after ds write not after
+ * stencil test otherwise new stencil values may not get written if all
+ * fragments got killed by depth/stencil test.
+ */
+ if (!simple_shader && key->stencil[0].enabled)
+ lp_build_mask_check(&mask);
}
lp_build_interp_soa_update_inputs_dyn(interp, gallivm, loop_state.counter);