diff options
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_quad_depth_test.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_depth_test.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c index 0b5d909b2d..268a1f947e 100644 --- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c +++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c @@ -74,6 +74,7 @@ depth_test_quad(struct quad_stage *qs, struct quad_header *quad) switch (softpipe->depth_test.func) { case PIPE_FUNC_NEVER: + /* zmask = 0 */ break; case PIPE_FUNC_LESS: /* Note this is pretty much a single sse or cell instruction. @@ -96,7 +97,27 @@ depth_test_quad(struct quad_stage *qs, struct quad_header *quad) zmask |= (1 << j); } break; - /* XXX fill in remaining cases */ + case PIPE_FUNC_GREATER: + for (j = 0; j < QUAD_SIZE; j++) { + if (qzzzz[j] > bzzzz[j]) + zmask |= (1 << j); + } + break; + case PIPE_FUNC_NOTEQUAL: + for (j = 0; j < QUAD_SIZE; j++) { + if (qzzzz[j] != bzzzz[j]) + zmask |= (1 << j); + } + break; + case PIPE_FUNC_GEQUAL: + for (j = 0; j < QUAD_SIZE; j++) { + if (qzzzz[j] >= bzzzz[j]) + zmask |= (1 << j); + } + break; + case PIPE_FUNC_ALWAYS: + zmask = MASK_ALL; + break; default: abort(); } @@ -117,7 +138,8 @@ depth_test_quad(struct quad_stage *qs, struct quad_header *quad) sps->write_quad_z(sps, quad->x0, quad->y0, bzzzz); } - qs->next->run(qs->next, quad); + if (quad->mask) + qs->next->run(qs->next, quad); } |