struct softpipe_query* sq;
assert(type == PIPE_QUERY_OCCLUSION_COUNTER ||
+ type == PIPE_QUERY_OCCLUSION_PREDICATE ||
type == PIPE_QUERY_TIME_ELAPSED ||
type == PIPE_QUERY_SO_STATISTICS ||
+ type == PIPE_QUERY_SO_OVERFLOW_PREDICATE ||
type == PIPE_QUERY_PRIMITIVES_EMITTED ||
type == PIPE_QUERY_PRIMITIVES_GENERATED ||
type == PIPE_QUERY_PIPELINE_STATISTICS ||
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
sq->start = softpipe->occlusion_count;
break;
- case PIPE_QUERY_TIMESTAMP_DISJOINT:
case PIPE_QUERY_TIME_ELAPSED:
sq->start = os_time_get_nano();
break;
softpipe->num_primitives_generated = 0;
sq->so.num_primitives_written = 0;
softpipe->so_stats.num_primitives_written = 0;
+ break;
+ case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+ sq->end = FALSE;
+ break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
sq->so.num_primitives_written = 0;
softpipe->so_stats.num_primitives_written = 0;
break;
case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_GPU_FINISHED:
+ case PIPE_QUERY_TIMESTAMP_DISJOINT:
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
/* reset our cache */
softpipe->active_query_count--;
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
sq->end = softpipe->occlusion_count;
break;
case PIPE_QUERY_TIMESTAMP:
sq->start = 0;
/* fall through */
- case PIPE_QUERY_TIMESTAMP_DISJOINT:
case PIPE_QUERY_TIME_ELAPSED:
sq->end = os_time_get_nano();
break;
+ case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+ sq->end = (softpipe->num_primitives_generated >
+ softpipe->so_stats.num_primitives_written);
+ break;
case PIPE_QUERY_SO_STATISTICS:
sq->num_primitives_generated =
softpipe->num_primitives_generated;
sq->num_primitives_generated = softpipe->num_primitives_generated;
break;
case PIPE_QUERY_GPU_FINISHED:
+ case PIPE_QUERY_TIMESTAMP_DISJOINT:
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
sq->stats.ia_vertices =
static boolean
softpipe_get_query_result(struct pipe_context *pipe,
- struct pipe_query *q,
- boolean wait,
- union pipe_query_result *vresult)
+ struct pipe_query *q,
+ boolean wait,
+ union pipe_query_result *vresult)
{
struct softpipe_query *sq = softpipe_query(q);
uint64_t *result = (uint64_t*)vresult;
sizeof(struct pipe_query_data_pipeline_statistics));;
break;
case PIPE_QUERY_GPU_FINISHED:
- *result = TRUE;
+ vresult->b = TRUE;
+ break;
+ case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+ vresult->b = sq->end != 0;
break;
case PIPE_QUERY_TIMESTAMP_DISJOINT: {
- struct pipe_query_data_timestamp_disjoint td;
+ struct pipe_query_data_timestamp_disjoint *td =
+ (struct pipe_query_data_timestamp_disjoint *)vresult;
/* os_get_time_nano return nanoseconds */
- td.frequency = UINT64_C(1000000000);
- td.disjoint = sq->end != sq->start;
- memcpy(vresult, &td,
- sizeof(struct pipe_query_data_timestamp_disjoint));
+ td->frequency = UINT64_C(1000000000);
+ td->disjoint = FALSE;
}
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
case PIPE_QUERY_PRIMITIVES_GENERATED:
*result = sq->num_primitives_generated;
break;
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
+ vresult->b = sq->end - sq->start != 0;
+ break;
default:
*result = sq->end - sq->start;
break;