diff options
author | Brian Paul <[email protected]> | 2013-04-01 17:51:43 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-04-03 09:56:08 -0600 |
commit | 3838edaf5d3f75ca5c2276db22ea0b96fce2bad7 (patch) | |
tree | bfbf4127c4d08f694bbe74100d827deb45f84c7f /src/gallium/drivers/svga/svga_screen.c | |
parent | 49ed1f3cb335fada1f9ee26d5420889292da3c92 (diff) |
svga: add HUD queries for number of draw calls, number of fallbacks
The fallbacks count is the number of drawing calls that use a "draw"
module fallback, such as polygon stipple.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 49059a5d294..bd1b03fc66c 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -492,6 +492,27 @@ svga_fence_finish(struct pipe_screen *screen, } +static int +svga_get_driver_query_info(struct pipe_screen *screen, + unsigned index, + struct pipe_driver_query_info *info) +{ + static const struct pipe_driver_query_info queries[] = { + {"draw-calls", SVGA_QUERY_DRAW_CALLS, 0, FALSE}, + {"fallbacks", SVGA_QUERY_FALLBACKS, 0, FALSE} + }; + + if (!info) + return Elements(queries); + + if (index >= Elements(queries)) + return 0; + + *info = queries[index]; + return 1; +} + + static void svga_destroy_screen( struct pipe_screen *screen ) { @@ -551,6 +572,7 @@ svga_screen_create(struct svga_winsys_screen *sws) screen->fence_reference = svga_fence_reference; screen->fence_signalled = svga_fence_signalled; screen->fence_finish = svga_fence_finish; + screen->get_driver_query_info = svga_get_driver_query_info; svgascreen->sws = sws; svga_init_screen_resource_functions(svgascreen); |