[Mesa-dev] [PATCH 1/2] gallium/u_blitter: add code to save/set/restore min_samples for msaa

Marek Olšák maraeo at gmail.com
Wed Dec 13 19:34:10 UTC 2017


On Mon, Dec 11, 2017 at 9:09 PM, Brian Paul <brianp at vmware.com> wrote:
> Will be used by the next patch.
> ---
>  src/gallium/auxiliary/util/u_blitter.c |  8 ++++++++
>  src/gallium/auxiliary/util/u_blitter.h | 11 +++++++++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
> index 476ef08..371daf1 100644
> --- a/src/gallium/auxiliary/util/u_blitter.c
> +++ b/src/gallium/auxiliary/util/u_blitter.c
> @@ -646,6 +646,12 @@ void util_blitter_restore_fragment_states(struct blitter_context *blitter)
>        ctx->base.is_sample_mask_saved = false;
>     }
>
> +   /* Min samples. */
> +   if (ctx->base.is_min_samples_saved) {
> +      pipe->set_min_samples(pipe, ctx->base.saved_min_samples);
> +      ctx->base.is_min_samples_saved = false;
> +   }
> +
>     /* Miscellaneous states. */
>     /* XXX check whether these are saved and whether they need to be restored
>      * (depending on the operation) */
> @@ -1675,6 +1681,8 @@ static void do_blits(struct blitter_context_priv *ctx,
>
>     blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
>
> +   pipe->set_min_samples(pipe, 1);

Some drivers like r300 and svga don't implement set_min_samples.

With that fixed:

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

Marek

> +
>     if ((src_target == PIPE_TEXTURE_1D ||
>          src_target == PIPE_TEXTURE_2D ||
>          src_target == PIPE_TEXTURE_RECT) &&
> diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h
> index dba7739..251cd9b 100644
> --- a/src/gallium/auxiliary/util/u_blitter.h
> +++ b/src/gallium/auxiliary/util/u_blitter.h
> @@ -117,6 +117,9 @@ struct blitter_context
>     bool is_sample_mask_saved;
>     unsigned saved_sample_mask;
>
> +   bool is_min_samples_saved;
> +   unsigned saved_min_samples;
> +
>     unsigned saved_num_sampler_states;
>     void *saved_sampler_states[PIPE_MAX_SAMPLERS];
>
> @@ -546,6 +549,14 @@ util_blitter_save_sample_mask(struct blitter_context *blitter,
>  }
>
>  static inline void
> +util_blitter_save_min_samples(struct blitter_context *blitter,
> +                              unsigned min_samples)
> +{
> +   blitter->is_min_samples_saved = true;
> +   blitter->saved_min_samples = min_samples;
> +}
> +
> +static inline void
>  util_blitter_save_render_condition(struct blitter_context *blitter,
>                                     struct pipe_query *query,
>                                     bool condition,
> --
> 1.9.1
>
> _______________________________________________
> 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