[Mesa-dev] [PATCH 3/3] mesa: only emit _NEW_MULTISAMPLE when min sample shading changes

Marek Olšák maraeo at gmail.com
Mon Jun 5 21:32:58 UTC 2017


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Jun 2, 2017 at 5:52 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> We usually check that given parameters are different before
> updating the state.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/mesa/main/multisample.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
> index 16fe2b7ced..07786130d5 100644
> --- a/src/mesa/main/multisample.c
> +++ b/src/mesa/main/multisample.c
> @@ -140,10 +140,13 @@ _mesa_MinSampleShading(GLclampf value)
>        return;
>     }
>
> -   FLUSH_VERTICES(ctx, 0);
> +   value = CLAMP(value, 0.0f, 1.0f);
> +
> +   if (ctx->Multisample.MinSampleShadingValue == value)
> +      return;
>
> -   ctx->Multisample.MinSampleShadingValue = CLAMP(value, 0.0f, 1.0f);
> -   ctx->NewState |= _NEW_MULTISAMPLE;
> +   FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
> +   ctx->Multisample.MinSampleShadingValue = value;
>  }
>
>  /**
> --
> 2.13.0
>
> _______________________________________________
> 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