From: Keith Whitwell Date: Thu, 19 Feb 2009 14:46:23 +0000 (+0000) Subject: softpipe: add dumping of post-tranfsormed vertices (disabled) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a321b8ed6ea583f43f8d5ab5d1b918a96df44f1d;p=mesa.git softpipe: add dumping of post-tranfsormed vertices (disabled) --- 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 */ }