summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-03-25 19:18:56 -0600
committerBrian <[email protected]>2008-03-25 19:21:36 -0600
commit9f7cd571e01569abd0898fdee62d0e0f946bf3a8 (patch)
tree6b7ae9cca310440ffc80d5b7dbb8ea557078d98b
parent542e3464a45b9d407b7f2a7fb8a4c5b92c769189 (diff)
gallium: added fragment emit/write debug counters
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_setup.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_prim_setup.c b/src/gallium/drivers/softpipe/sp_prim_setup.c
index 6a81e4d8cc2..c7eb12b3bb7 100644
--- a/src/gallium/drivers/softpipe/sp_prim_setup.c
+++ b/src/gallium/drivers/softpipe/sp_prim_setup.c
@@ -44,6 +44,7 @@
#include "pipe/p_shader_tokens.h"
#define DEBUG_VERTS 0
+#define DEBUG_FRAGS 0
/**
* Triangle edge info
@@ -92,6 +93,11 @@ struct setup_stage {
unsigned y_flags;
unsigned mask; /**< mask of MASK_BOTTOM/TOP_LEFT/RIGHT bits */
} span;
+
+#if DEBUG_FRAGS
+ uint numFragsEmitted; /**< per primitive */
+ uint numFragsWritten; /**< per primitive */
+#endif
};
@@ -160,7 +166,20 @@ emit_quad( struct setup_stage *setup, int x, int y, unsigned mask )
setup->quad.x0 = x;
setup->quad.y0 = y;
setup->quad.mask = mask;
+#if DEBUG_FRAGS
+ if (mask & 1) setup->numFragsEmitted++;
+ if (mask & 2) setup->numFragsEmitted++;
+ if (mask & 4) setup->numFragsEmitted++;
+ if (mask & 8) setup->numFragsEmitted++;
+#endif
sp->quad.first->run(sp->quad.first, &setup->quad);
+#if DEBUG_FRAGS
+ mask = setup->quad.mask;
+ if (mask & 1) setup->numFragsWritten++;
+ if (mask & 2) setup->numFragsWritten++;
+ if (mask & 4) setup->numFragsWritten++;
+ if (mask & 8) setup->numFragsWritten++;
+#endif
}
@@ -674,6 +693,11 @@ static void setup_tri( struct draw_stage *stage,
debug_printf("%s\n", __FUNCTION__ );
*/
+#if DEBUG_FRAGS
+ setup->numFragsEmitted = 0;
+ setup->numFragsWritten = 0;
+#endif
+
setup_sort_vertices( setup, prim );
setup_tri_coefficients( setup );
setup_tri_edges( setup );
@@ -702,6 +726,12 @@ static void setup_tri( struct draw_stage *stage,
}
flush_spans( setup );
+
+#if DEBUG_FRAGS
+ printf("Tri: %u frags emitted, %u written\n",
+ setup->numFragsEmitted,
+ setup->numFragsWritten);
+#endif
}