summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_query.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-08-23 23:08:43 +0200
committerRoland Scheidegger <[email protected]>2013-08-27 16:59:39 +0200
commitbd3909f265908e30ef0e569fab57e9a042750b3a (patch)
treec98086d22693a9eab4900a7df27046573b831e0e /src/gallium/drivers/softpipe/sp_query.c
parentaff2ecf09a92eb79eef560f17d77badf69782e7c (diff)
draw: clean up setting stream out information a bit
In particular noone is interested in the vertex count, so drop that, and also drop the duplicated num_primitives_generated / so.primitives_storage_needed variables in drivers. I am unable for now to figure out if primitives_storage_needed in SO stats (used for d3d10) should increase if SO is disabled, though the equivalent num_primitives_generated used for OpenGL definitely should increase. In any case we were only counting when SO is active both in softpipe and llvmpipe anyway so don't pretend there's an independent num_primitives_generated counter which would count always. (This means the PIPE_QUERY_PRIMITIVES_GENERATED count will still be wrong just as before, should eventually fix this by doing either separate counting for this query or adjust the code so it always counts this even if SO is inactive depending on what's correct for d3d10.) Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_query.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_query.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index ca15f03464d..99c5d4cf41b 100644
--- a/src/gallium/drivers/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
@@ -42,8 +42,6 @@ struct softpipe_query {
uint64_t start;
uint64_t end;
struct pipe_query_data_so_statistics so;
- unsigned num_primitives_generated;
-
struct pipe_query_data_pipeline_statistics stats;
};
@@ -100,7 +98,7 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
break;
case PIPE_QUERY_SO_STATISTICS:
sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
- sq->so.primitives_storage_needed = softpipe->num_primitives_generated;
+ sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
sq->end = FALSE;
@@ -109,7 +107,7 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- sq->num_primitives_generated = softpipe->num_primitives_generated;
+ sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_GPU_FINISHED:
@@ -155,23 +153,23 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
sq->so.num_primitives_written =
softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written;
- sq->num_primitives_generated =
- softpipe->num_primitives_generated - sq->num_primitives_generated;
- sq->end = sq->num_primitives_generated > sq->so.num_primitives_written;
+ sq->so.primitives_storage_needed =
+ softpipe->so_stats.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;
sq->so.primitives_storage_needed =
- softpipe->num_primitives_generated - sq->so.primitives_storage_needed;
+ softpipe->so_stats.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;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- sq->num_primitives_generated =
- softpipe->num_primitives_generated - sq->num_primitives_generated;
+ sq->so.primitives_storage_needed =
+ softpipe->so_stats.primitives_storage_needed - sq->so.primitives_storage_needed;
break;
case PIPE_QUERY_GPU_FINISHED:
case PIPE_QUERY_TIMESTAMP_DISJOINT:
@@ -243,7 +241,7 @@ softpipe_get_query_result(struct pipe_context *pipe,
*result = sq->so.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- *result = sq->num_primitives_generated;
+ *result = sq->so.primitives_storage_needed;
break;
case PIPE_QUERY_OCCLUSION_PREDICATE:
vresult->b = sq->end - sq->start != 0;