diff options
author | Dave Airlie <airlied@redhat.com> | 2009-03-20 10:52:17 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-20 10:52:17 +1000 |
commit | 407e8ae5b167b0193e1e5b1266a5d61ed836dfb5 (patch) | |
tree | 2d9d05a5c3122f41a13aa8bd9ae921c1176e6b0d /src/gallium/drivers/cell/ppu/cell_vbuf.c | |
parent | bdaa0341caffc353fd26bbd91865c2d86eed11c1 (diff) | |
parent | 114bb54324f22cb53bcd14607234d0acd74d37bd (diff) |
Merge remote branch 'main/master' into radeon-rewrite
Conflicts:
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/r300/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_screen.c
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_vbuf.c')
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_vbuf.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_vbuf.c b/src/gallium/drivers/cell/ppu/cell_vbuf.c index ab54e79689..cfaffb52a8 100644 --- a/src/gallium/drivers/cell/ppu/cell_vbuf.c +++ b/src/gallium/drivers/cell/ppu/cell_vbuf.c @@ -62,6 +62,7 @@ struct cell_vbuf_render uint vertex_size; /**< in bytes */ void *vertex_buffer; /**< just for debug, really */ uint vertex_buf; /**< in [0, CELL_NUM_BUFFERS-1] */ + uint vertex_buffer_size; /**< size in bytes */ }; @@ -82,24 +83,26 @@ cell_vbuf_get_vertex_info(struct vbuf_render *vbr) } -static void * +static boolean cell_vbuf_allocate_vertices(struct vbuf_render *vbr, ushort vertex_size, ushort nr_vertices) { struct cell_vbuf_render *cvbr = cell_vbuf_render(vbr); + unsigned size = vertex_size * nr_vertices; /*printf("Alloc verts %u * %u\n", vertex_size, nr_vertices);*/ assert(cvbr->vertex_buf == ~0); cvbr->vertex_buf = cell_get_empty_buffer(cvbr->cell); cvbr->vertex_buffer = cvbr->cell->buffer[cvbr->vertex_buf]; + cvbr->vertex_buffer_size = size; cvbr->vertex_size = vertex_size; - return cvbr->vertex_buffer; + + return cvbr->vertex_buffer != NULL; } static void -cell_vbuf_release_vertices(struct vbuf_render *vbr, void *vertices, - unsigned vertex_size, unsigned vertices_used) +cell_vbuf_release_vertices(struct vbuf_render *vbr) { struct cell_vbuf_render *cvbr = cell_vbuf_render(vbr); struct cell_context *cell = cvbr->cell; @@ -127,11 +130,29 @@ cell_vbuf_release_vertices(struct vbuf_render *vbr, void *vertices, cvbr->vertex_buf = ~0; cell_flush_int(cell, 0x0); - assert(vertices == cvbr->vertex_buffer); cvbr->vertex_buffer = NULL; } +static void * +cell_vbuf_map_vertices(struct vbuf_render *vbr) +{ + struct cell_vbuf_render *cvbr = cell_vbuf_render(vbr); + return cvbr->vertex_buffer; +} + + +static void +cell_vbuf_unmap_vertices(struct vbuf_render *vbr, + ushort min_index, + ushort max_index ) +{ + struct cell_vbuf_render *cvbr = cell_vbuf_render(vbr); + assert( cvbr->vertex_buffer_size >= (max_index+1) * cvbr->vertex_size ); + /* do nothing */ +} + + static boolean cell_vbuf_set_primitive(struct vbuf_render *vbr, unsigned prim) @@ -295,6 +316,8 @@ cell_init_vbuf(struct cell_context *cell) cell->vbuf_render->base.get_vertex_info = cell_vbuf_get_vertex_info; cell->vbuf_render->base.allocate_vertices = cell_vbuf_allocate_vertices; + cell->vbuf_render->base.map_vertices = cell_vbuf_map_vertices; + cell->vbuf_render->base.unmap_vertices = cell_vbuf_unmap_vertices; cell->vbuf_render->base.set_primitive = cell_vbuf_set_primitive; cell->vbuf_render->base.draw = cell_vbuf_draw; cell->vbuf_render->base.release_vertices = cell_vbuf_release_vertices; |