diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-03-02 13:27:46 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-03-02 13:27:46 +0000 |
commit | 97a1fd158c9acfaa3a8deda7eb5bf0b253e85c15 (patch) | |
tree | 37e6c11507c1ef044aa8f0ee009136bb1d8b5bbc /src/gallium/drivers/softpipe/sp_prim_vbuf.c | |
parent | 60e5fe65067da76dea816535bec1e9073adc0ba7 (diff) | |
parent | b70f344e223fc10df8df08a6d82a813505225712 (diff) |
Merge commit 'origin/master' into gallium-map-range
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_prim_vbuf.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_prim_vbuf.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index d56eed80a4..eef6e5806c 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -60,6 +60,7 @@ struct softpipe_vbuf_render struct softpipe_context *softpipe; uint prim; uint vertex_size; + uint nr_vertices; uint vertex_buffer_size; void *vertex_buffer; }; @@ -95,12 +96,44 @@ sp_vbuf_allocate_vertices(struct vbuf_render *vbr, } cvbr->vertex_size = vertex_size; + cvbr->nr_vertices = nr_vertices; + return cvbr->vertex_buffer != NULL; } static void sp_vbuf_release_vertices(struct vbuf_render *vbr) { +#if 0 + { + struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr); + const struct vertex_info *info = + softpipe_get_vbuf_vertex_info(cvbr->softpipe); + const float *vtx = (const float *) cvbr->vertex_buffer; + uint i, j; + debug_printf("%s (vtx_size = %u, vtx_used = %u)\n", + __FUNCTION__, cvbr->vertex_size, cvbr->nr_vertices); + for (i = 0; i < cvbr->nr_vertices; i++) { + for (j = 0; j < info->num_attribs; j++) { + uint k; + switch (info->attrib[j].emit) { + case EMIT_4F: k = 4; break; + case EMIT_3F: k = 3; break; + case EMIT_2F: k = 2; break; + case EMIT_1F: k = 1; break; + default: assert(0); + } + debug_printf("Vert %u attr %u: ", i, j); + while (k-- > 0) { + debug_printf("%g ", vtx[0]); + vtx++; + } + debug_printf("\n"); + } + } + } +#endif + /* keep the old allocation for next time */ } |