mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
st/mesa: make use of the occlusion predicate query
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
50235ab3ab
commit
7aca4bb9b1
1 changed files with 10 additions and 2 deletions
|
|
@ -96,7 +96,8 @@ st_BeginQuery(struct gl_context *ctx, struct gl_query_object *q)
|
|||
switch (q->Target) {
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
|
||||
/* fall-through */
|
||||
type = PIPE_QUERY_OCCLUSION_PREDICATE;
|
||||
break;
|
||||
case GL_SAMPLES_PASSED_ARB:
|
||||
type = PIPE_QUERY_OCCLUSION_COUNTER;
|
||||
break;
|
||||
|
|
@ -240,7 +241,14 @@ get_query_result(struct pipe_context *pipe,
|
|||
stq->base.Result = data.pipeline_statistics.c_primitives;
|
||||
break;
|
||||
default:
|
||||
stq->base.Result = data.u64;
|
||||
switch (stq->type) {
|
||||
case PIPE_QUERY_OCCLUSION_PREDICATE:
|
||||
stq->base.Result = !!data.b;
|
||||
break;
|
||||
default:
|
||||
stq->base.Result = data.u64;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue