From 5d8359ff4d8c379fdf1a78758f405bb4cdf69459 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 28 Jul 2017 06:35:41 +0200 Subject: [PATCH] radeonsi: expose MRT-draw-calls to HUD MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_pipe_common.h | 1 + src/gallium/drivers/radeon/r600_query.c | 7 +++++++ src/gallium/drivers/radeon/r600_query.h | 1 + src/gallium/drivers/radeonsi/si_state_draw.c | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index c2fb3690d2b..4e3b42a112f 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -587,6 +587,7 @@ struct r600_common_context { unsigned num_cs_dw_queries_suspend; /* Misc stats. */ unsigned num_draw_calls; + unsigned num_mrt_draw_calls; unsigned num_prim_restart_calls; unsigned num_spill_draw_calls; unsigned num_compute_calls; diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index db70878d1df..e716d4bf156 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -99,6 +99,9 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx, case R600_QUERY_DRAW_CALLS: query->begin_result = rctx->num_draw_calls; break; + case R600_QUERY_MRT_DRAW_CALLS: + query->begin_result = rctx->num_mrt_draw_calls; + break; case R600_QUERY_PRIM_RESTART_CALLS: query->begin_result = rctx->num_prim_restart_calls; break; @@ -253,6 +256,9 @@ static bool r600_query_sw_end(struct r600_common_context *rctx, case R600_QUERY_DRAW_CALLS: query->end_result = rctx->num_draw_calls; break; + case R600_QUERY_MRT_DRAW_CALLS: + query->end_result = rctx->num_mrt_draw_calls; + break; case R600_QUERY_PRIM_RESTART_CALLS: query->end_result = rctx->num_prim_restart_calls; break; @@ -1851,6 +1857,7 @@ static struct pipe_driver_query_info r600_driver_query_list[] = { X("num-shaders-created", NUM_SHADERS_CREATED, UINT64, CUMULATIVE), X("num-shader-cache-hits", NUM_SHADER_CACHE_HITS, UINT64, CUMULATIVE), X("draw-calls", DRAW_CALLS, UINT64, AVERAGE), + X("MRT-draw-calls", MRT_DRAW_CALLS, UINT64, AVERAGE), X("prim-restart-calls", PRIM_RESTART_CALLS, UINT64, AVERAGE), X("spill-draw-calls", SPILL_DRAW_CALLS, UINT64, AVERAGE), X("compute-calls", COMPUTE_CALLS, UINT64, AVERAGE), diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h index 1bbaa76e584..e176246122d 100644 --- a/src/gallium/drivers/radeon/r600_query.h +++ b/src/gallium/drivers/radeon/r600_query.h @@ -42,6 +42,7 @@ struct r600_resource; enum { R600_QUERY_DRAW_CALLS = PIPE_QUERY_DRIVER_SPECIFIC, + R600_QUERY_MRT_DRAW_CALLS, R600_QUERY_PRIM_RESTART_CALLS, R600_QUERY_SPILL_DRAW_CALLS, R600_QUERY_COMPUTE_CALLS, diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index c1edf7f3706..a5f5b7f98a0 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -1392,6 +1392,8 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) } sctx->b.num_draw_calls++; + if (sctx->framebuffer.state.nr_cbufs > 1) + sctx->b.num_mrt_draw_calls++; if (info->primitive_restart) sctx->b.num_prim_restart_calls++; if (G_0286E8_WAVESIZE(sctx->spi_tmpring_size)) -- 2.30.2