summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-10 21:22:03 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-10 21:22:03 -0700
commit44f4b9b9ea81974a8e7de444280e471ca05e9261 (patch)
tree734d82d216d900306ccc6b53e1d6b7d360aaaf9a
parent02f6f9f8d47fc36c8edf4661c4e78c9c1a1941fc (diff)
Cell: avoid copying vertex data
-rw-r--r--src/mesa/pipe/cell/spu/main.c49
-rw-r--r--src/mesa/pipe/cell/spu/tri.c6
-rw-r--r--src/mesa/pipe/cell/spu/tri.h2
3 files changed, 10 insertions, 47 deletions
diff --git a/src/mesa/pipe/cell/spu/main.c b/src/mesa/pipe/cell/spu/main.c
index 84134b893a..27e1169a7f 100644
--- a/src/mesa/pipe/cell/spu/main.c
+++ b/src/mesa/pipe/cell/spu/main.c
@@ -174,6 +174,9 @@ tile_bounding_box(const struct cell_command_render *render,
*tymin = 0;
*box_num_tiles = fb.width_tiles * fb.height_tiles;
*box_width_tiles = fb.width_tiles;
+ (void) render;
+ (void) txmax;
+ (void) tymax;
#else
uint txmax, tymax, box_height_tiles;
@@ -255,26 +258,9 @@ render(const struct cell_command_render *render)
for (j = 0; j < render->num_verts; j += 3) {
struct prim_header prim;
- /*
- printf(" %u: Triangle %g,%g %g,%g %g,%g\n",
- init.id,
- prim_buffer.vertex[j*3+0][0][0],
- prim_buffer.vertex[j*3+0][0][1],
- prim_buffer.vertex[j*3+1][0][0],
- prim_buffer.vertex[j*3+1][0][1],
- prim_buffer.vertex[j*3+2][0][0],
- prim_buffer.vertex[j*3+2][0][1]);
- */
-
- /* pos */
- COPY_4V(prim.v[0].data[0], prim_buffer.vertex[j+0][0]);
- COPY_4V(prim.v[1].data[0], prim_buffer.vertex[j+1][0]);
- COPY_4V(prim.v[2].data[0], prim_buffer.vertex[j+2][0]);
-
- /* color */
- COPY_4V(prim.v[0].data[1], prim_buffer.vertex[j+0][1]);
- COPY_4V(prim.v[1].data[1], prim_buffer.vertex[j+1][1]);
- COPY_4V(prim.v[2].data[1], prim_buffer.vertex[j+2][1]);
+ prim.v[0] = (struct vertex_header *) prim_buffer.vertex[j+0];
+ prim.v[1] = (struct vertex_header *) prim_buffer.vertex[j+1];
+ prim.v[2] = (struct vertex_header *) prim_buffer.vertex[j+2];
tri_draw(&prim, tx, ty);
}
@@ -391,26 +377,9 @@ render_vbuf(const struct cell_command_render_vbuf *render)
v1 = vbuf + indexes[j+1] * render->num_attribs * 4;
v2 = vbuf + indexes[j+2] * render->num_attribs * 4;
- /*
- printf(" %u: Triangle %g,%g %g,%g %g,%g\n",
- init.id,
- prim_buffer.vertex[j*3+0][0][0],
- prim_buffer.vertex[j*3+0][0][1],
- prim_buffer.vertex[j*3+1][0][0],
- prim_buffer.vertex[j*3+1][0][1],
- prim_buffer.vertex[j*3+2][0][0],
- prim_buffer.vertex[j*3+2][0][1]);
- */
-
- /* pos */
- COPY_4V(prim.v[0].data[0], v0);
- COPY_4V(prim.v[1].data[0], v1);
- COPY_4V(prim.v[2].data[0], v2);
-
- /* color */
- COPY_4V(prim.v[0].data[1], v0 + 4);
- COPY_4V(prim.v[1].data[1], v1 + 4);
- COPY_4V(prim.v[2].data[1], v2 + 4);
+ prim.v[0] = (struct vertex_header *) v0;
+ prim.v[1] = (struct vertex_header *) v1;
+ prim.v[2] = (struct vertex_header *) v2;
tri_draw(&prim, tx, ty);
}
diff --git a/src/mesa/pipe/cell/spu/tri.c b/src/mesa/pipe/cell/spu/tri.c
index f902bf2126..77f7052cd5 100644
--- a/src/mesa/pipe/cell/spu/tri.c
+++ b/src/mesa/pipe/cell/spu/tri.c
@@ -455,15 +455,9 @@ static void print_vertex(const struct setup_stage *setup,
static boolean setup_sort_vertices( struct setup_stage *setup,
const struct prim_header *prim )
{
-#if 0
const struct vertex_header *v0 = prim->v[0];
const struct vertex_header *v1 = prim->v[1];
const struct vertex_header *v2 = prim->v[2];
-#else
- const struct vertex_header *v0 = &prim->v[0];
- const struct vertex_header *v1 = &prim->v[1];
- const struct vertex_header *v2 = &prim->v[2];
-#endif
#if DEBUG_VERTS
fprintf(stderr, "Triangle:\n");
diff --git a/src/mesa/pipe/cell/spu/tri.h b/src/mesa/pipe/cell/spu/tri.h
index 01612a2579..bcb42852b2 100644
--- a/src/mesa/pipe/cell/spu/tri.h
+++ b/src/mesa/pipe/cell/spu/tri.h
@@ -40,7 +40,7 @@ struct vertex_header {
struct prim_header {
- struct vertex_header v[3];
+ struct vertex_header *v[3];
uint color;
};