diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-02-05 14:23:34 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-02-05 15:08:06 -0700 |
commit | 4da82fd5c5e0a7535e30aa81f08dcbe1a26358b7 (patch) | |
tree | 21c7bfe48efb55638d2632f8c835cc0581c000aa /src/mesa/pipe/cell/ppu | |
parent | 2174890ed030bde8494b7f13b7090e27771695fa (diff) |
Cell: re-enable inlined vertex buffers
Vertex data must be on a 16-byte address/offset so SIMD operations will work
properly in the SPU code.
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_vbuf.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_vbuf.c b/src/mesa/pipe/cell/ppu/cell_vbuf.c index 0fee61821a..e9fafe492e 100644 --- a/src/mesa/pipe/cell/ppu/cell_vbuf.c +++ b/src/mesa/pipe/cell/ppu/cell_vbuf.c @@ -40,7 +40,7 @@ /** Allow vertex data to be inlined after RENDER command */ -#define ALLOW_INLINE_VERTS 0 +#define ALLOW_INLINE_VERTS 1 /** @@ -199,9 +199,7 @@ cell_vbuf_draw(struct vbuf_render *vbr, { const uint index_bytes = ROUNDUP8(nr_indices * 2); const uint vertex_bytes = nr_vertices * 4 * cell->vertex_info.size; - - const uint batch_size = sizeof(struct cell_command_render) - + index_bytes; + const uint batch_size = sizeof(struct cell_command_render) + index_bytes; struct cell_command_render *render = (struct cell_command_render *) @@ -223,9 +221,9 @@ cell_vbuf_draw(struct vbuf_render *vbr, render->num_verts = nr_vertices; if (ALLOW_INLINE_VERTS && min_index == 0 && - vertex_bytes <= cell_batch_free_space(cell)) { - /* vertex data inlined, after indices */ - void *dst = cell_batch_alloc(cell, vertex_bytes); + vertex_bytes + 16 <= cell_batch_free_space(cell)) { + /* vertex data inlined, after indices, at 16-byte boundary */ + void *dst = cell_batch_alloc_aligned(cell, vertex_bytes, 16); memcpy(dst, vertices, vertex_bytes); render->inline_verts = TRUE; render->vertex_buf = ~0; |