diff options
author | Marek Olšák <[email protected]> | 2015-08-02 16:57:39 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-08-06 20:44:37 +0200 |
commit | 70f5e49ba5ca8eb063a0d7db94fbef1585b21b2d (patch) | |
tree | 20a7162a2595b3094db1337e203dfe4503e8b2f8 /src/gallium/drivers/radeon/r600_query.c | |
parent | 028528215a8a6d0a5945256cc67709eef2e68189 (diff) |
radeonsi: add a HUD query showing the number of compiler invocations
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_query.c')
-rw-r--r-- | src/gallium/drivers/radeon/r600_query.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 11f838f38a7..5f64ec660c6 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -92,6 +92,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_common_context *c case R600_QUERY_CURRENT_GPU_SCLK: case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_GPU_LOAD: + case R600_QUERY_NUM_COMPILATIONS: return NULL; } @@ -408,6 +409,7 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q case R600_QUERY_CURRENT_GPU_SCLK: case R600_QUERY_CURRENT_GPU_MCLK: case R600_QUERY_GPU_LOAD: + case R600_QUERY_NUM_COMPILATIONS: skip_allocation = true; break; default: @@ -483,6 +485,9 @@ static boolean r600_begin_query(struct pipe_context *ctx, case R600_QUERY_GPU_LOAD: rquery->begin_result = r600_gpu_load_begin(rctx->screen); return true; + case R600_QUERY_NUM_COMPILATIONS: + rquery->begin_result = p_atomic_read(&rctx->screen->num_compilations); + return true; } /* Discard the old query buffers. */ @@ -560,6 +565,9 @@ static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query) case R600_QUERY_GPU_LOAD: rquery->end_result = r600_gpu_load_end(rctx->screen, rquery->begin_result); return; + case R600_QUERY_NUM_COMPILATIONS: + rquery->end_result = p_atomic_read(&rctx->screen->num_compilations); + return; } r600_emit_query_end(rctx, rquery); @@ -619,6 +627,7 @@ static boolean r600_get_query_buffer_result(struct r600_common_context *ctx, case R600_QUERY_GPU_TEMPERATURE: case R600_QUERY_CURRENT_GPU_SCLK: case R600_QUERY_CURRENT_GPU_MCLK: + case R600_QUERY_NUM_COMPILATIONS: result->u64 = query->end_result - query->begin_result; return TRUE; case R600_QUERY_GPU_LOAD: |