Mesa (master): softpipe: restore/fix print_vertex() debug helper
Brian Paul
brianp at kemper.freedesktop.org
Fri Oct 9 13:25:32 UTC 2009
Module: Mesa
Branch: master
Commit: f36123323c9d696fec6e54882242cab15247ab0d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f36123323c9d696fec6e54882242cab15247ab0d
Author: Brian Paul <brianp at vmware.com>
Date: Thu Oct 8 13:00:37 2009 -0600
softpipe: restore/fix print_vertex() debug helper
---
src/gallium/drivers/softpipe/sp_setup.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index e55e209..00fb52a 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -106,6 +106,7 @@ struct setup_context {
#endif
unsigned winding; /* which winding to cull */
+ unsigned nr_vertex_attrs;
};
@@ -268,8 +269,8 @@ static void print_vertex(const struct setup_context *setup,
const float (*v)[4])
{
int i;
- debug_printf(" Vertex: (%p)\n", v);
- for (i = 0; i < setup->quad[0].nr_attrs; i++) {
+ debug_printf(" Vertex: (%p)\n", (void *) v);
+ for (i = 0; i < setup->nr_vertex_attrs; i++) {
debug_printf(" %d: %f %f %f %f\n", i,
v[i][0], v[i][1], v[i][2], v[i][3]);
if (util_is_inf_or_nan(v[i][0])) {
@@ -1254,6 +1255,9 @@ void sp_setup_prepare( struct setup_context *setup )
softpipe_update_derived(sp);
}
+ /* Note: nr_attrs is only used for debugging (vertex printing) */
+ setup->nr_vertex_attrs = draw_num_vs_outputs(sp->draw);
+
sp->quad.first->begin( sp->quad.first );
if (sp->reduced_api_prim == PIPE_PRIM_TRIANGLES &&
More information about the mesa-commit
mailing list