summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_depth_test.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-07-24 16:49:35 +0100
committerKeith Whitwell <keithw@vmware.com>2009-07-24 16:49:35 +0100
commitab9fb5167023a26566b53e98f206dd73a18000f3 (patch)
tree8c0942f9a0fd31173e5dd18be0a5ef88a4b83ff3 /src/gallium/drivers/softpipe/sp_quad_depth_test.c
parent6153a1c28f118be1a74ffee0e19c16fb83b5cab7 (diff)
softpipe: 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/softpipe/sp_quad_depth_test.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 768b9275b3..8f223a7eae 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -49,7 +49,7 @@
* Try to effectively do that with codegen...
*/
-void
+boolean
sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
@@ -193,6 +193,8 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
quad->inout.mask &= zmask;
+ if (quad->inout.mask == 0)
+ return FALSE;
if (softpipe->depth_stencil->depth.writemask) {
@@ -252,16 +254,25 @@ sp_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)
{
- sp_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 (sp_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 *sp_quad_depth_test_stage( struct softpipe_context *softpipe )
stage->softpipe = softpipe;
stage->begin = depth_test_begin;
- stage->run = depth_test_quad;
+ stage->run = depth_test_quads;
stage->destroy = depth_test_destroy;
return stage;