summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_quad_earlyz.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-07-24 16:49:35 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:18 +0100
commitbdbb4beb21876010b14785569a920fa65a67d1ad (patch)
tree40b8f2d0f6d4020c4229ab2e582f9b7e2a03bb5c /src/gallium/drivers/llvmpipe/lp_quad_earlyz.c
parent4486012245c5f526059d3872ac3561f53705d1cf (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_earlyz.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_quad_earlyz.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_quad_earlyz.c b/src/gallium/drivers/llvmpipe/lp_quad_earlyz.c
index e4b4c3b55c..915d2d9f78 100644
--- a/src/gallium/drivers/llvmpipe/lp_quad_earlyz.c
+++ b/src/gallium/drivers/llvmpipe/lp_quad_earlyz.c
@@ -43,20 +43,26 @@
static void
earlyz_quad(
struct quad_stage *qs,
- struct quad_header *quad )
+ struct quad_header *quads[],
+ unsigned nr )
{
- const float fx = (float) quad->input.x0;
- const float fy = (float) quad->input.y0;
- const float dzdx = quad->posCoef->dadx[2];
- const float dzdy = quad->posCoef->dady[2];
- const float z0 = quad->posCoef->a0[2] + dzdx * fx + dzdy * fy;
+ const float a0z = quads[0]->posCoef->a0[2];
+ const float dzdx = quads[0]->posCoef->dadx[2];
+ const float dzdy = quads[0]->posCoef->dady[2];
+ unsigned i;
- quad->output.depth[0] = z0;
- quad->output.depth[1] = z0 + dzdx;
- quad->output.depth[2] = z0 + dzdy;
- quad->output.depth[3] = z0 + dzdx + dzdy;
+ for (i = 0; i < nr; i++) {
+ const float fx = (float) quads[i]->input.x0;
+ const float fy = (float) quads[i]->input.y0;
+ const float z0 = a0z + dzdx * fx + dzdy * fy;
- qs->next->run( qs->next, quad );
+ quads[i]->output.depth[0] = z0;
+ quads[i]->output.depth[1] = z0 + dzdx;
+ quads[i]->output.depth[2] = z0 + dzdy;
+ quads[i]->output.depth[3] = z0 + dzdx + dzdy;
+ }
+
+ qs->next->run( qs->next, quads, nr );
}
static void