diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-24 16:49:35 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:18 +0100 |
commit | bdbb4beb21876010b14785569a920fa65a67d1ad (patch) | |
tree | 40b8f2d0f6d4020c4229ab2e582f9b7e2a03bb5c /src/gallium/drivers/llvmpipe/lp_quad_depth_test.c | |
parent | 4486012245c5f526059d3872ac3561f53705d1cf (diff) |
llvmpipe: expand quad pipeline to process >1 quad at a time
This is part one -- we still only pass a single quad down, but
the code can now cope with more. The quads must all be from the same
tile.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_quad_depth_test.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_quad_depth_test.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_quad_depth_test.c b/src/gallium/drivers/llvmpipe/lp_quad_depth_test.c index fdb64ac3b4..8ecd68393f 100644 --- a/src/gallium/drivers/llvmpipe/lp_quad_depth_test.c +++ b/src/gallium/drivers/llvmpipe/lp_quad_depth_test.c @@ -49,7 +49,7 @@ * Try to effectively do that with codegen... */ -void +boolean lp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad) { struct llvmpipe_context *llvmpipe = qs->llvmpipe; @@ -193,6 +193,8 @@ lp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad) } quad->inout.mask &= zmask; + if (quad->inout.mask == 0) + return FALSE; if (llvmpipe->depth_stencil->depth.writemask) { @@ -252,16 +254,25 @@ lp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad) assert(0); } } + + return TRUE; } static void -depth_test_quad(struct quad_stage *qs, struct quad_header *quad) +depth_test_quads(struct quad_stage *qs, + struct quad_header *quads[], + unsigned nr) { - lp_depth_test_quad(qs, quad); + unsigned i, pass = 0; - if (quad->inout.mask) - qs->next->run(qs->next, quad); + for (i = 0; i < nr; i++) { + if (lp_depth_test_quad(qs, quads[i])) + quads[pass++] = quads[i]; + } + + if (pass) + qs->next->run(qs->next, quads, pass); } @@ -283,7 +294,7 @@ struct quad_stage *lp_quad_depth_test_stage( struct llvmpipe_context *llvmpipe ) stage->llvmpipe = llvmpipe; stage->begin = depth_test_begin; - stage->run = depth_test_quad; + stage->run = depth_test_quads; stage->destroy = depth_test_destroy; return stage; |