[Mesa-dev] [PATCH v2 4/5] st/mesa: make use of the occlusion predicate query
Marek Olšák
maraeo at gmail.com
Mon Feb 8 12:48:21 UTC 2016
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
On Sun, Feb 7, 2016 at 2:54 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Reviewed-by: Marek Olšák <marek.olsak at amd.com> (v1)
>
> v1 -> v2: read .b for result of predicate
> ---
> src/mesa/state_tracker/st_cb_queryobj.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
> index fc239bc..cdb9efc 100644
> --- a/src/mesa/state_tracker/st_cb_queryobj.c
> +++ b/src/mesa/state_tracker/st_cb_queryobj.c
> @@ -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;
> }
>
> --
> 2.4.10
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list