summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-24 16:47:23 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-24 16:47:23 -0700
commitfa82d863684a89ff8c56c3b0196488c15024f743 (patch)
tree4a229091bd1be174d6eda613ce0170e751d1b456 /src/mesa/pipe/cell/ppu
parent0673c571c79d00d05328bf41e9c6a52bfb0f7324 (diff)
Cell: send actual vertex size in the render command
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_render.c2
-rw-r--r--src/mesa/pipe/cell/ppu/cell_vbuf.c26
2 files changed, 5 insertions, 23 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_render.c b/src/mesa/pipe/cell/ppu/cell_render.c
index ecdd47e28b..4ab277a4b2 100644
--- a/src/mesa/pipe/cell/ppu/cell_render.c
+++ b/src/mesa/pipe/cell/ppu/cell_render.c
@@ -152,7 +152,7 @@ cell_flush_prim_buffer(struct cell_context *cell)
struct cell_command_render *render = &cell_global.command[i].render;
render->prim_type = PIPE_PRIM_TRIANGLES;
render->num_verts = cell->prim_buffer.num_verts;
- render->num_attribs = CELL_MAX_ATTRIBS;
+ render->vertex_size = cell->vertex_info->size * 4;
render->xmin = cell->prim_buffer.xmin;
render->ymin = cell->prim_buffer.ymin;
render->xmax = cell->prim_buffer.xmax;
diff --git a/src/mesa/pipe/cell/ppu/cell_vbuf.c b/src/mesa/pipe/cell/ppu/cell_vbuf.c
index a420de041a..711d03b49f 100644
--- a/src/mesa/pipe/cell/ppu/cell_vbuf.c
+++ b/src/mesa/pipe/cell/ppu/cell_vbuf.c
@@ -31,7 +31,9 @@
*/
+#include "cell_batch.h"
#include "cell_context.h"
+#include "cell_flush.h"
#include "cell_spu.h"
#include "cell_vbuf.h"
#include "pipe/draw/draw_vbuf.h"
@@ -141,26 +143,7 @@ cell_vbuf_draw(struct vbuf_render *vbr,
if (cvbr->prim != PIPE_PRIM_TRIANGLES)
return; /* only render tris for now */
-#if 0
- for (i = 0; i < cell->num_spus; i++) {
- struct cell_command_render *render = &cell_global.command[i].render;
- render->opcode = CELL_CMD_RENDER;
- render->prim_type = cvbr->prim;
- render->num_verts = nr_vertices;
- render->num_attribs = CELL_MAX_ATTRIBS; /* XXX fix */
- render->vertex_data = vertices;
- render->index_data = indices;
- render->num_indexes = nr_indices;
- render->xmin = xmin;
- render->ymin = ymin;
- render->xmax = xmax;
- render->ymax = ymax;
-
- ASSERT_ALIGN16(render->vertex_data);
- ASSERT_ALIGN16(render->index_data);
- send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_RENDER);
- }
-#else
+ /* build/insert batch RENDER command */
{
struct cell_command_render *render
= (struct cell_command_render *)
@@ -168,7 +151,7 @@ cell_vbuf_draw(struct vbuf_render *vbr,
render->opcode = CELL_CMD_RENDER;
render->prim_type = cvbr->prim;
render->num_verts = nr_vertices;
- render->num_attribs = CELL_MAX_ATTRIBS; /* XXX fix */
+ render->vertex_size = 4 * cell->vertex_info.size;
render->vertex_data = vertices;
render->index_data = indices;
render->num_indexes = nr_indices;
@@ -180,7 +163,6 @@ cell_vbuf_draw(struct vbuf_render *vbr,
ASSERT_ALIGN16(render->vertex_data);
ASSERT_ALIGN16(render->index_data);
}
-#endif
#if 01
/* XXX this is temporary */