[Mesa-dev] [PATCH 08/12] cso: remove clip state handling

Ilia Mirkin imirkin at alum.mit.edu
Thu Jul 16 10:14:35 PDT 2015


Sssort of. But drivers that were expecting this to happen will now
need to do the compare themselves. For example nv50 (and I assume
nvc0) just always copy the new values in and set the dirty flag.
Really you're just pushing this down into the driver, which is
reasonable, but in the process you're regressing a bunch of drivers
(in terms of state updates).

On Thu, Jul 16, 2015 at 12:54 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> There is no need for this.
> ---
>  src/gallium/auxiliary/cso_cache/cso_context.c | 44 ---------------------------
>  src/gallium/auxiliary/cso_cache/cso_context.h | 13 --------
>  src/mesa/state_tracker/st_atom_clip.c         |  2 +-
>  3 files changed, 1 insertion(+), 58 deletions(-)
>
> diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
> index 1b4e2e6..3e7fe22 100644
> --- a/src/gallium/auxiliary/cso_cache/cso_context.c
> +++ b/src/gallium/auxiliary/cso_cache/cso_context.c
> @@ -111,9 +111,6 @@ struct cso_context {
>     uint render_condition_mode, render_condition_mode_saved;
>     boolean render_condition_cond, render_condition_cond_saved;
>
> -   struct pipe_clip_state clip;
> -   struct pipe_clip_state clip_saved;
> -
>     struct pipe_framebuffer_state fb, fb_saved;
>     struct pipe_viewport_state vp, vp_saved;
>     struct pipe_blend_color blend_color;
> @@ -910,47 +907,6 @@ void cso_restore_tesseval_shader(struct cso_context *ctx)
>     ctx->tesseval_shader_saved = NULL;
>  }
>
> -/* clip state */
> -
> -static INLINE void
> -clip_state_cpy(struct pipe_clip_state *dst,
> -               const struct pipe_clip_state *src)
> -{
> -   memcpy(dst->ucp, src->ucp, sizeof(dst->ucp));
> -}
> -
> -static INLINE int
> -clip_state_cmp(const struct pipe_clip_state *a,
> -               const struct pipe_clip_state *b)
> -{
> -   return memcmp(a->ucp, b->ucp, sizeof(a->ucp));
> -}
> -
> -void
> -cso_set_clip(struct cso_context *ctx,
> -             const struct pipe_clip_state *clip)
> -{
> -   if (clip_state_cmp(&ctx->clip, clip)) {
> -      clip_state_cpy(&ctx->clip, clip);
> -      ctx->pipe->set_clip_state(ctx->pipe, clip);
> -   }
> -}
> -
> -void
> -cso_save_clip(struct cso_context *ctx)
> -{
> -   clip_state_cpy(&ctx->clip_saved, &ctx->clip);
> -}
> -
> -void
> -cso_restore_clip(struct cso_context *ctx)
> -{
> -   if (clip_state_cmp(&ctx->clip, &ctx->clip_saved)) {
> -      clip_state_cpy(&ctx->clip, &ctx->clip_saved);
> -      ctx->pipe->set_clip_state(ctx->pipe, &ctx->clip_saved);
> -   }
> -}
> -
>  enum pipe_error
>  cso_set_vertex_elements(struct cso_context *ctx,
>                          unsigned count,
> diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
> index c9a4226..3bee429 100644
> --- a/src/gallium/auxiliary/cso_cache/cso_context.h
> +++ b/src/gallium/auxiliary/cso_cache/cso_context.h
> @@ -188,19 +188,6 @@ void cso_save_render_condition(struct cso_context *cso);
>  void cso_restore_render_condition(struct cso_context *cso);
>
>
> -/* clip state */
> -
> -void
> -cso_set_clip(struct cso_context *cso,
> -             const struct pipe_clip_state *clip);
> -
> -void
> -cso_save_clip(struct cso_context *cso);
> -
> -void
> -cso_restore_clip(struct cso_context *cso);
> -
> -
>  /* sampler view state */
>
>  void
> diff --git a/src/mesa/state_tracker/st_atom_clip.c b/src/mesa/state_tracker/st_atom_clip.c
> index f82c133..0d2a7e1 100644
> --- a/src/mesa/state_tracker/st_atom_clip.c
> +++ b/src/mesa/state_tracker/st_atom_clip.c
> @@ -60,7 +60,7 @@ static void update_clip( struct st_context *st )
>            use_eye ? ctx->Transform.EyeUserPlane
>                    : ctx->Transform._ClipUserPlane, sizeof(clip.ucp));
>     st->state.clip = clip;
> -   cso_set_clip(st->cso_context, &clip);
> +   st->pipe->set_clip_state(st->pipe, &clip);
>  }
>
>
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list