diff options
author | Dave Airlie <[email protected]> | 2015-05-27 17:37:46 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2019-04-09 11:19:38 +1000 |
commit | ddb9ad363d900e00898b591fe0793622257acc47 (patch) | |
tree | e753d9d20acfa016023d4de68886407567b26042 /src/gallium/drivers/softpipe/sp_query.c | |
parent | 00fe67c01545030a10387fe939275bae2da2d7dd (diff) |
softpipe: add support for indexed queries.
We need indexed queries to retrieve the geom shader info.
Reviewed-by: Roland Scheidegger <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_query.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_query.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c index 5c9afe6fe47..7187c562068 100644 --- a/src/gallium/drivers/softpipe/sp_query.c +++ b/src/gallium/drivers/softpipe/sp_query.c @@ -39,6 +39,7 @@ struct softpipe_query { unsigned type; + unsigned index; uint64_t start; uint64_t end; struct pipe_query_data_so_statistics so; @@ -73,7 +74,7 @@ softpipe_create_query(struct pipe_context *pipe, type == PIPE_QUERY_TIMESTAMP_DISJOINT); sq = CALLOC_STRUCT( softpipe_query ); sq->type = type; - + sq->index = index; return (struct pipe_query *)sq; } @@ -101,8 +102,8 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) sq->start = os_time_get_nano(); break; case PIPE_QUERY_SO_STATISTICS: - sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written; - sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed; + sq->so.num_primitives_written = softpipe->so_stats[0].num_primitives_written; + sq->so.primitives_storage_needed = softpipe->so_stats[0].primitives_storage_needed; break; case PIPE_QUERY_SO_OVERFLOW_PREDICATE: case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE: @@ -110,10 +111,10 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed; break; case PIPE_QUERY_PRIMITIVES_EMITTED: - sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written; + sq->so.num_primitives_written = softpipe->so_stats[sq->index].num_primitives_written; break; case PIPE_QUERY_PRIMITIVES_GENERATED: - sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed; + sq->so.primitives_storage_needed = softpipe->so_stats[sq->index].primitives_storage_needed; break; case PIPE_QUERY_TIMESTAMP: case PIPE_QUERY_GPU_FINISHED: @@ -161,24 +162,24 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q) case PIPE_QUERY_SO_OVERFLOW_PREDICATE: case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE: sq->so.num_primitives_written = - softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written; + softpipe->so_stats[0].num_primitives_written - sq->so.num_primitives_written; sq->so.primitives_storage_needed = - softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed; + softpipe->so_stats[0].primitives_storage_needed - sq->so.primitives_storage_needed; sq->end = sq->so.primitives_storage_needed > sq->so.num_primitives_written; break; case PIPE_QUERY_SO_STATISTICS: sq->so.num_primitives_written = - softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written; + softpipe->so_stats[sq->index].num_primitives_written - sq->so.num_primitives_written; sq->so.primitives_storage_needed = - softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed; + softpipe->so_stats[sq->index].primitives_storage_needed - sq->so.primitives_storage_needed; break; case PIPE_QUERY_PRIMITIVES_EMITTED: sq->so.num_primitives_written = - softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written; + softpipe->so_stats[sq->index].num_primitives_written - sq->so.num_primitives_written; break; case PIPE_QUERY_PRIMITIVES_GENERATED: sq->so.primitives_storage_needed = - softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed; + softpipe->so_stats[sq->index].primitives_storage_needed - sq->so.primitives_storage_needed; break; case PIPE_QUERY_GPU_FINISHED: case PIPE_QUERY_TIMESTAMP_DISJOINT: |