[Mesa-dev] [PATCH] swrast: fix GL_ANY_SAMPLES_PASSED values in Result

Brian Paul brianp at vmware.com
Sat Mar 5 01:13:10 UTC 2016


On 03/03/2016 07:02 PM, Ilia Mirkin wrote:
> Since commit 922be4eab, the expectation is that the query result
> contains the correct value. Unfortunately swrast does not distinguish
> between GL_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED. As a result, we
> must fix up the query result in a post-draw fixup.
>
> Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D94274&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=QpL4ebdKGLz2VcCpBgsSDbi7BxcwF1fUKAPVLNZHo80&s=5GBr_B_K9wZ4XP3CkFsQPbDoO7x-ayRlShmW3-wycIE&e=
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Tested-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   src/mesa/swrast/s_context.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
> index af24207..0a5fc7e 100644
> --- a/src/mesa/swrast/s_context.c
> +++ b/src/mesa/swrast/s_context.c
> @@ -900,11 +900,16 @@ void
>   _swrast_render_finish( struct gl_context *ctx )
>   {
>      SWcontext *swrast = SWRAST_CONTEXT(ctx);
> +   struct gl_query_object *query = ctx->Query.CurrentOcclusionObject;
>
>      _swrast_flush(ctx);
>
>      if (swrast->Driver.SpanRenderFinish)
>         swrast->Driver.SpanRenderFinish( ctx );
> +
> +   if (query && (query->Target == GL_ANY_SAMPLES_PASSED ||
> +                 query->Target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE))
> +      query->Result = !!query->Result;
>   }
>
>
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list