aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pt_emit.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-04-11 06:11:29 -0700
committerZack Rusin <[email protected]>2013-04-16 23:38:47 -0700
commit80ee4a407a2668f6a6a410c3e56ae9910510f773 (patch)
treefef704d3c130eb615a0e9f4d9631288d45513749 /src/gallium/auxiliary/draw/draw_pt_emit.c
parentb739376cffec19870804b1ebd4bef3c2f654e943 (diff)
draw: implement pipeline statistics in the draw module
This is a basic implementation of the pipeline statistics in the draw module. The interface is similar to the stream output statistics and also requires that the callers explicitly enable it. Included is the implementation of the interface in llvmpipe and softpipe. Only softpipe enables the pipeline statistics capability though because llvmpipe is lacking gathering of the fragment shading and rasterization statistics. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_emit.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index 942ddc4d7bc..b3d3546402d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -33,6 +33,7 @@
#include "draw/draw_pt.h"
#include "translate/translate.h"
#include "translate/translate_cache.h"
+#include "util/u_prim.h"
struct pt_emit {
struct draw_context *draw;
@@ -179,6 +180,12 @@ draw_pt_emit(struct pt_emit *emit,
i < prim_info->primitive_count;
start += prim_info->primitive_lengths[i], i++)
{
+ if (draw->collect_statistics) {
+ draw->statistics.c_invocations +=
+ u_decomposed_prims_for_vertices(prim_info->prim,
+ prim_info->primitive_lengths[i]);
+ }
+
render->draw_elements(render,
elts + start,
prim_info->primitive_lengths[i]);
@@ -252,11 +259,17 @@ draw_pt_emit_linear(struct pt_emit *emit,
i < prim_info->primitive_count;
start += prim_info->primitive_lengths[i], i++)
{
+ if (draw->collect_statistics) {
+ draw->statistics.c_invocations +=
+ u_decomposed_prims_for_vertices(prim_info->prim,
+ prim_info->primitive_lengths[i]);
+ }
+
render->draw_arrays(render,
start,
prim_info->primitive_lengths[i]);
}
-
+
render->release_vertices(render);
return;