diff options
author | Keith Whitwell <[email protected]> | 2009-02-19 14:46:23 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-02-27 15:23:21 +0000 |
commit | a321b8ed6ea583f43f8d5ab5d1b918a96df44f1d (patch) | |
tree | 7ea059fc8bdd5acb95012458aa4930beb84481a9 /src/gallium/drivers | |
parent | cf89f063634ff89cbd732bf67950debc94897ed9 (diff) |
softpipe: add dumping of post-tranfsormed vertices (disabled)
Diffstat (limited to 'src/gallium/drivers')
-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 d56eed80a4f..eef6e5806c9 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 */ } |