llvmpipe: implement PIPE_QUERY_SO_STATISTICS
We were missing the implementation of PIPE_QUERY_SO_STATISTICS query, this change implements it on top of the existing facilities. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
7466e0b6c8
commit
c1cd19c3b8
|
@ -137,6 +137,13 @@ llvmpipe_get_query_result(struct pipe_context *pipe,
|
||||||
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
||||||
*result = pq->num_primitives_written;
|
*result = pq->num_primitives_written;
|
||||||
break;
|
break;
|
||||||
|
case PIPE_QUERY_SO_STATISTICS: {
|
||||||
|
struct pipe_query_data_so_statistics *stats =
|
||||||
|
(struct pipe_query_data_so_statistics *)vresult;
|
||||||
|
stats->num_primitives_written = pq->num_primitives_written;
|
||||||
|
stats->primitives_storage_needed = pq->num_primitives_generated;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
|
@ -174,6 +181,13 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
|
||||||
llvmpipe->num_primitives_generated = 0;
|
llvmpipe->num_primitives_generated = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pq->type == PIPE_QUERY_SO_STATISTICS) {
|
||||||
|
pq->num_primitives_written = 0;
|
||||||
|
llvmpipe->so_stats.num_primitives_written = 0;
|
||||||
|
pq->num_primitives_generated = 0;
|
||||||
|
llvmpipe->num_primitives_generated = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (pq->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
if (pq->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
||||||
llvmpipe->active_occlusion_query = TRUE;
|
llvmpipe->active_occlusion_query = TRUE;
|
||||||
llvmpipe->dirty |= LP_NEW_OCCLUSION_QUERY;
|
llvmpipe->dirty |= LP_NEW_OCCLUSION_QUERY;
|
||||||
|
@ -197,6 +211,11 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
|
||||||
pq->num_primitives_generated = llvmpipe->num_primitives_generated;
|
pq->num_primitives_generated = llvmpipe->num_primitives_generated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pq->type == PIPE_QUERY_SO_STATISTICS) {
|
||||||
|
pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
|
||||||
|
pq->num_primitives_generated = llvmpipe->num_primitives_generated;
|
||||||
|
}
|
||||||
|
|
||||||
if (pq->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
if (pq->type == PIPE_QUERY_OCCLUSION_COUNTER) {
|
||||||
assert(llvmpipe->active_occlusion_query);
|
assert(llvmpipe->active_occlusion_query);
|
||||||
llvmpipe->active_occlusion_query = FALSE;
|
llvmpipe->active_occlusion_query = FALSE;
|
||||||
|
|
|
@ -476,6 +476,7 @@ lp_rast_begin_query(struct lp_rasterizer_task *task,
|
||||||
break;
|
break;
|
||||||
case PIPE_QUERY_PRIMITIVES_GENERATED:
|
case PIPE_QUERY_PRIMITIVES_GENERATED:
|
||||||
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
||||||
|
case PIPE_QUERY_SO_STATISTICS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
@ -507,6 +508,7 @@ lp_rast_end_query(struct lp_rasterizer_task *task,
|
||||||
break;
|
break;
|
||||||
case PIPE_QUERY_PRIMITIVES_GENERATED:
|
case PIPE_QUERY_PRIMITIVES_GENERATED:
|
||||||
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
case PIPE_QUERY_PRIMITIVES_EMITTED:
|
||||||
|
case PIPE_QUERY_SO_STATISTICS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
Loading…
Reference in New Issue