diff options
author | Zack Rusin <[email protected]> | 2013-04-17 15:19:34 -0700 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-04-17 15:28:54 -0700 |
commit | 6bb217a4898b64add9c0a3b77cc0ce48409988f7 (patch) | |
tree | 086bc8a304aec4613b826a8a187346511663f7af /src | |
parent | cb58c79efb1402cd89504856033b6322d0096233 (diff) |
softpipe/so: use the correct variable for reporting stream out
we were using the wrong vars, reporting incorrect stream output
statistics.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_query.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c index 62411de5036..b444e378085 100644 --- a/src/gallium/drivers/softpipe/sp_query.c +++ b/src/gallium/drivers/softpipe/sp_query.c @@ -98,6 +98,10 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) break; case PIPE_QUERY_SO_STATISTICS: sq->so.primitives_storage_needed = 0; + sq->num_primitives_generated = 0; + softpipe->num_primitives_generated = 0; + sq->so.num_primitives_written = 0; + softpipe->so_stats.num_primitives_written = 0; case PIPE_QUERY_PRIMITIVES_EMITTED: sq->so.num_primitives_written = 0; softpipe->so_stats.num_primitives_written = 0; @@ -147,8 +151,11 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q) sq->end = os_time_get_nano(); break; case PIPE_QUERY_SO_STATISTICS: - sq->so.primitives_storage_needed = - softpipe->so_stats.primitives_storage_needed; + sq->num_primitives_generated = + softpipe->num_primitives_generated; + sq->so.num_primitives_written = + softpipe->so_stats.num_primitives_written; + break; case PIPE_QUERY_PRIMITIVES_EMITTED: sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written; @@ -196,9 +203,12 @@ softpipe_get_query_result(struct pipe_context *pipe, uint64_t *result = (uint64_t*)vresult; switch (sq->type) { - case PIPE_QUERY_SO_STATISTICS: - memcpy(vresult, &sq->so, - sizeof(struct pipe_query_data_so_statistics)); + case PIPE_QUERY_SO_STATISTICS: { + struct pipe_query_data_so_statistics *stats = + (struct pipe_query_data_so_statistics *)vresult; + stats->num_primitives_written = sq->so.num_primitives_written; + stats->primitives_storage_needed = sq->num_primitives_generated; + } break; case PIPE_QUERY_PIPELINE_STATISTICS: memcpy(vresult, &sq->stats, |