summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-10-19 14:02:01 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-10-19 14:02:01 +0100
commit2f5f357c5b67869e75087fc1f17ed0d666fb134e (patch)
tree0790c40fb5e0a97a3191172096bc63876bea3471 /src/gallium
parent0580079864c41c236a4167a1543b1a2fc5090362 (diff)
llvmpipe: Reshape the shader input from 8x2 to 4x4.
Incorrect rendering until the interpolation code generation is updated.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_tri.c19
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_soa.h4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_soa.py6
3 files changed, 14 insertions, 15 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index f9a8be20c7..c63aa22198 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -34,7 +34,7 @@
#include "lp_tile_soa.h"
-#define BLOCKSIZE 8
+#define BLOCKSIZE 4
/* Convert 8x8 block into four runs of quads and render each in turn.
@@ -55,11 +55,9 @@ static void block_full( struct lp_rasterizer *rast,
const struct lp_rast_triangle *tri,
int x, int y )
{
- const unsigned masks[4] = {~0, ~0, 0, 0}; /* FIXME: Wasting quads!!! */
- int iy;
+ const unsigned masks[4] = {~0, ~0, ~0, ~0};
- for (iy = 0; iy < 4; iy += 2)
- lp_rast_shade_quads(rast, &tri->inputs, x, y + iy, masks);
+ lp_rast_shade_quads(rast, &tri->inputs, x, y, masks);
}
#endif
@@ -124,30 +122,29 @@ do_block( struct lp_rasterizer *rast,
int ix, iy;
+ unsigned masks[2][2] = {{0, 0}, {0, 0}};
+
for (iy = 0; iy < BLOCKSIZE; iy += 2) {
int cx1 = c1;
int cx2 = c2;
int cx3 = c3;
- unsigned masks[4] = {0, 0, 0, 0};
-
for (ix = 0; ix < BLOCKSIZE; ix += 2) {
- masks[ix >> 1] = do_quad(tri, x + ix, y + iy, cx1, cx2, cx3);
+ masks[iy >> 1][ix >> 1] = do_quad(tri, x + ix, y + iy, cx1, cx2, cx3);
cx1 += xstep1;
cx2 += xstep2;
cx3 += xstep3;
}
- if(masks[0] || masks[1] || masks[2] || masks[3])
- lp_rast_shade_quads(rast, &tri->inputs, x, y + iy, masks);
-
c1 += ystep1;
c2 += ystep2;
c3 += ystep3;
}
+ if(masks[0][0] || masks[0][1] || masks[1][0] || masks[1][1])
+ lp_rast_shade_quads(rast, &tri->inputs, x, y, &masks[0][0]);
}
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.h b/src/gallium/drivers/llvmpipe/lp_tile_soa.h
index 040b01865d..d72d6d2ef1 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.h
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.h
@@ -46,8 +46,8 @@ struct pipe_transfer;
#define TILE_SIZE 64
-#define TILE_VECTOR_HEIGHT 2
-#define TILE_VECTOR_WIDTH 8
+#define TILE_VECTOR_HEIGHT 4
+#define TILE_VECTOR_WIDTH 4
extern const unsigned char
tile_offset[TILE_VECTOR_HEIGHT][TILE_VECTOR_WIDTH];
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
index 004c5c979e..a603b7f9f4 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py
+++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py
@@ -259,8 +259,10 @@ def main():
print
print 'const unsigned char'
print 'tile_offset[TILE_VECTOR_HEIGHT][TILE_VECTOR_WIDTH] = {'
- print ' { 0, 1, 4, 5, 8, 9, 12, 13},'
- print ' { 2, 3, 6, 7, 10, 11, 14, 15}'
+ print ' { 0, 1, 4, 5},'
+ print ' { 2, 3, 6, 7},'
+ print ' { 8, 9, 12, 13},'
+ print ' { 10, 11, 14, 15}'
print '};'
print