From 30a7e0c021c3a77c20c6f041dc80b7dc90ad238f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 2 Aug 2015 21:12:18 +0200 Subject: radeonsi: add a HUD query showing the number of shaders created MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Paul Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeon/r600_query.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gallium/drivers/radeon/r600_query.c') diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 5f64ec660c6..de1cdf0fbd3 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -93,6 +93,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_common_context *c case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_GPU_LOAD: case R600_QUERY_NUM_COMPILATIONS: + case R600_QUERY_NUM_SHADERS_CREATED: return NULL; } @@ -410,6 +411,7 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_GPU_LOAD: case R600_QUERY_NUM_COMPILATIONS: + case R600_QUERY_NUM_SHADERS_CREATED: skip_allocation = true; break; default: @@ -488,6 +490,9 @@ static boolean r600_begin_query(struct pipe_context *ctx, case R600_QUERY_NUM_COMPILATIONS: rquery->begin_result = p_atomic_read(&rctx->screen->num_compilations); return true; + case R600_QUERY_NUM_SHADERS_CREATED: + rquery->begin_result = p_atomic_read(&rctx->screen->num_shaders_created); + return true; } /* Discard the old query buffers. */ @@ -568,6 +573,9 @@ static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query) case R600_QUERY_NUM_COMPILATIONS: rquery->end_result = p_atomic_read(&rctx->screen->num_compilations); return; + case R600_QUERY_NUM_SHADERS_CREATED: + rquery->end_result = p_atomic_read(&rctx->screen->num_shaders_created); + return; } r600_emit_query_end(rctx, rquery); @@ -628,6 +636,7 @@ static boolean r600_get_query_buffer_result(struct r600_common_context *ctx, case R600_QUERY_CURRENT_GPU_SCLK: case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_NUM_COMPILATIONS: + case R600_QUERY_NUM_SHADERS_CREATED: result->u64 = query->end_result - query->begin_result; return TRUE; case R600_QUERY_GPU_LOAD: -- cgit v1.2.3