diff options
author | Brian Paul <[email protected]> | 2018-01-11 11:17:45 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-01-17 11:17:56 -0700 |
commit | 7027d9c1fd2a1bc0ef3cd523d407367f81a6eed5 (patch) | |
tree | d0a810bf5e33f6a10b803dca23a6f977e67c4768 /src/gallium/drivers/svga/svga_pipe_query.c | |
parent | 92840bd27683996d1de86fbc5b95be798f99796b (diff) |
svga: add num-commands-per-draw HUD query
This query shows the ratio of total commands vs. drawing commands sent
to the vgpu device. This gives some idea of how many state changes
are sent per draw call. The closer the ratio is to 1.0, the better.
Reviewed-by: Charmaine Lee <[email protected]>
Reviewed-by: Neha Bhende <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_query.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_query.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index 26924524372..cec95ed3b6f 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -751,6 +751,7 @@ svga_create_query(struct pipe_context *pipe, case SVGA_QUERY_NUM_CONST_BUF_UPDATES: case SVGA_QUERY_NUM_CONST_UPDATES: case SVGA_QUERY_NUM_FAILED_ALLOCATIONS: + case SVGA_QUERY_NUM_COMMANDS_PER_DRAW: break; case SVGA_QUERY_FLUSH_TIME: case SVGA_QUERY_MAP_BUFFER_TIME: @@ -832,6 +833,7 @@ svga_destroy_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_CONST_BUF_UPDATES: case SVGA_QUERY_NUM_CONST_UPDATES: case SVGA_QUERY_NUM_FAILED_ALLOCATIONS: + case SVGA_QUERY_NUM_COMMANDS_PER_DRAW: /* nothing */ break; default: @@ -945,6 +947,7 @@ svga_begin_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_SURFACE_VIEWS: case SVGA_QUERY_NUM_GENERATE_MIPMAP: case SVGA_QUERY_NUM_FAILED_ALLOCATIONS: + case SVGA_QUERY_NUM_COMMANDS_PER_DRAW: /* nothing */ break; default: @@ -1059,6 +1062,7 @@ svga_end_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_SURFACE_VIEWS: case SVGA_QUERY_NUM_GENERATE_MIPMAP: case SVGA_QUERY_NUM_FAILED_ALLOCATIONS: + case SVGA_QUERY_NUM_COMMANDS_PER_DRAW: /* nothing */ break; default: @@ -1196,6 +1200,10 @@ svga_get_query_result(struct pipe_context *pipe, case SVGA_QUERY_NUM_FAILED_ALLOCATIONS: vresult->u64 = svgascreen->hud.num_failed_allocations; break; + case SVGA_QUERY_NUM_COMMANDS_PER_DRAW: + vresult->f = (float) svga->swc->num_commands + / (float) svga->swc->num_draw_commands; + break; default: assert(!"unexpected query type in svga_get_query_result"); } |