diff options
author | José Fonseca <[email protected]> | 2012-10-30 19:45:25 +0000 |
---|---|---|
committer | Andreas Boll <[email protected]> | 2013-01-20 15:08:27 +0100 |
commit | 9e1050d72fb78b56b03304727abb122713a90ed1 (patch) | |
tree | bf94348aec696bd66ff810de7af03c0c98d95844 /src/gallium/drivers | |
parent | 18a9979dc138adc743f4c19acde7218538614db9 (diff) |
llvmpipe: Obey back writemask.
Tested with a modified glean tstencil2 test.
NOTE: This is a candidate for stable branches.
Reviewed-by: Brian Paul <[email protected]>
(cherry picked from commit f69fc3612768d9cfed974b9d6ecf6a70fa0db99c)
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_depth.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c index 8efa75c01d3..5c3715aa8fb 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c @@ -273,11 +273,17 @@ lp_build_stencil_op(struct lp_build_context *bld, res = lp_build_select(bld, front_facing, res, back_res); } - /* XXX what about the back-face writemask? */ - if (stencil[0].writemask != 0xff) { + if (stencil[0].writemask != 0xff || + (stencil[1].enabled && front_facing != NULL && stencil[1].writemask != 0xff)) { /* mask &= stencil[0].writemask */ LLVMValueRef writemask = lp_build_const_int_vec(bld->gallivm, bld->type, stencil[0].writemask); + if (stencil[1].enabled && stencil[1].writemask != stencil[0].writemask && front_facing != NULL) { + LLVMValueRef back_writemask = lp_build_const_int_vec(bld->gallivm, bld->type, + stencil[1].writemask); + writemask = lp_build_select(bld, front_facing, writemask, back_writemask); + } + mask = LLVMBuildAnd(builder, mask, writemask, ""); /* res = (res & mask) | (stencilVals & ~mask) */ res = lp_build_select_bitwise(bld, mask, res, stencilVals); |