summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_fs.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-04-11 06:11:29 -0700
committerZack Rusin <zackr@vmware.com>2013-04-16 23:38:47 -0700
commit80ee4a407a2668f6a6a410c3e56ae9910510f773 (patch)
treefef704d3c130eb615a0e9f4d9631288d45513749 /src/gallium/drivers/softpipe/sp_quad_fs.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 <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_quad_fs.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index f32fe5f4068..d379f6457e3 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -73,6 +73,11 @@ shade_quad(struct quad_stage *qs, struct quad_header *quad)
struct softpipe_context *softpipe = qs->softpipe;
struct tgsi_exec_machine *machine = softpipe->fs_machine;
+ if (softpipe->active_statistics_queries) {
+ softpipe->pipeline_statistics.ps_invocations +=
+ util_bitcount(quad->inout.mask);
+ }
+
/* run shader */
machine->flatshade_color = softpipe->rasterizer->flatshade ? TRUE : FALSE;
return softpipe->fs_variant->run( softpipe->fs_variant, machine, quad );