summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_rast_tri.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-01-21 14:59:01 -0700
committerBrian Paul <brianp@vmware.com>2010-01-21 15:39:57 -0700
commitcd9d9e2436a0815f6ed3a61d2cdf8fad53278506 (patch)
tree4361bb4916bf5e3148031fc6afe7bebf7fe3fc44 /src/gallium/drivers/llvmpipe/lp_rast_tri.c
parent63f249bf909cab60635c2df9122db86eaab6c421 (diff)
llvmpipe: added simple perf/statistics counting facility
Currently counting number of tris, how many tiles of each size are fully covered, partially covered or empty, etc. Set LP_DEBUG=counters to enable. Results are printed upon context destruction.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast_tri.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_tri.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
index b3d1e7dee4..e9d15727a7 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c
@@ -32,6 +32,7 @@
#include <limits.h>
#include "util/u_math.h"
#include "lp_debug.h"
+#include "lp_perf.h"
#include "lp_rast_priv.h"
#include "lp_tile_soa.h"
@@ -167,6 +168,7 @@ do_block_16( struct lp_rasterizer_task *rast_task,
cx2 + eo2 < 0 ||
cx3 + eo3 < 0) {
/* the block is completely outside the triangle - nop */
+ LP_COUNT(nr_empty_4);
}
else {
int px = x + pos_table4[i][0];
@@ -174,6 +176,7 @@ do_block_16( struct lp_rasterizer_task *rast_task,
/* Don't bother testing if the 4x4 block is entirely in/out of
* the triangle. It's a little faster to do it in the jit code.
*/
+ LP_COUNT(nr_non_empty_4);
do_block_4(rast_task, tri, px, py, cx1, cx2, cx3);
}
}
@@ -223,6 +226,7 @@ lp_rast_triangle( struct lp_rasterizer *rast,
cx2 + eo2 < 0 ||
cx3 + eo3 < 0) {
/* the block is completely outside the triangle - nop */
+ LP_COUNT(nr_empty_16);
}
else {
int px = x + pos_table16[i][0];
@@ -232,10 +236,12 @@ lp_rast_triangle( struct lp_rasterizer *rast,
cx2 + ei2 > 0 &&
cx3 + ei3 > 0) {
/* the block is completely inside the triangle */
+ LP_COUNT(nr_fully_covered_16);
block_full_16(rast_task, tri, px, py);
}
else {
/* the block is partially in/out of the triangle */
+ LP_COUNT(nr_partially_covered_16);
do_block_16(rast_task, tri, px, py, cx1, cx2, cx3);
}
}