*result = pq->num_primitives_written;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- vresult->b = pq->so_has_overflown;
+ vresult->b = pq->num_primitives_generated > pq->num_primitives_written;
break;
case PIPE_QUERY_SO_STATISTICS: {
struct pipe_query_data_so_statistics *stats =
switch (pq->type) {
case PIPE_QUERY_PRIMITIVES_EMITTED:
- pq->num_primitives_written = 0;
- llvmpipe->so_stats.num_primitives_written = 0;
+ pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- pq->num_primitives_generated = 0;
- llvmpipe->num_primitives_generated = 0;
+ pq->num_primitives_generated = llvmpipe->num_primitives_generated;
break;
case 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;
+ pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
+ pq->num_primitives_generated = llvmpipe->num_primitives_generated;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- pq->so_has_overflown = FALSE;
+ pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
+ pq->num_primitives_generated = llvmpipe->num_primitives_generated;
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
/* reset our cache */
switch (pq->type) {
case PIPE_QUERY_PRIMITIVES_EMITTED:
- pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
+ pq->num_primitives_written =
+ llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
- pq->num_primitives_generated = llvmpipe->num_primitives_generated;
+ pq->num_primitives_generated =
+ llvmpipe->num_primitives_generated - pq->num_primitives_generated;
break;
case PIPE_QUERY_SO_STATISTICS:
- pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written;
- pq->num_primitives_generated = llvmpipe->num_primitives_generated;
+ pq->num_primitives_written =
+ llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
+ pq->num_primitives_generated =
+ llvmpipe->num_primitives_generated - pq->num_primitives_generated;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- pq->so_has_overflown = (llvmpipe->num_primitives_generated >
- llvmpipe->so_stats.num_primitives_written);
+ pq->num_primitives_written =
+ llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written;
+ pq->num_primitives_generated =
+ llvmpipe->num_primitives_generated - pq->num_primitives_generated;
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
pq->stats.ia_vertices =