llvmpipe: fix issue with not writing new stencil values
authorRoland Scheidegger <sroland@vmware.com>
Wed, 22 May 2013 20:42:11 +0000 (22:42 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 22 May 2013 20:57:27 +0000 (22:57 +0200)
commit82d7733b52e7c124a268c68395de140641b50c05
tree39f01fe62d94939bf43c54aacda8984d47206e13
parent3c91ef0f297d7dd619c02c03b01a6d99c018ad8d
llvmpipe: fix issue with not writing new stencil values

We did mask checks between depth/stencil testing and depth/stencil write.
This meant that if the depth/stencil test killed off all fragments we never
actually wrote the new stencil value. This issue affected all early/late
test/write combinations.
So move the mask check after depth/stencil write (for early depth test,
could do the same for late depth test but might not be worth it at that
point so just skip it there).
This addresses https://bugs.freedesktop.org/show_bug.cgi?id=41787.
Piglit does not hit this issue because of the simple_shader optimization
in generate_fs_loop() which means we're skipping the mask checks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_bld_depth.c
src/gallium/drivers/llvmpipe/lp_state_fs.c