Mesa (master): cso: don't pass blend_color through cso_context

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 22 12:18:26 UTC 2020


Module: Mesa
Branch: master
Commit: a35014954b0257a8c520ab8d9a234324ec6be6cc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a35014954b0257a8c520ab8d9a234324ec6be6cc

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Dec  3 13:38:34 2020 -0500

cso: don't pass blend_color through cso_context

It's never saved or restored. Redundant state changes are already
filtered out by mesa/main.

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>

---

 src/gallium/auxiliary/cso_cache/cso_context.c | 11 -----------
 src/gallium/auxiliary/cso_cache/cso_context.h |  4 ----
 src/mesa/state_tracker/st_atom_blend.c        |  3 ++-
 3 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 88a3d1f2a33..a2324c8952e 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -123,7 +123,6 @@ struct cso_context {
 
    struct pipe_framebuffer_state fb, fb_saved;
    struct pipe_viewport_state vp, vp_saved;
-   struct pipe_blend_color blend_color;
    unsigned sample_mask, sample_mask_saved;
    unsigned min_samples, min_samples_saved;
    struct pipe_stencil_ref stencil_ref, stencil_ref_saved;
@@ -798,16 +797,6 @@ cso_restore_viewport(struct cso_context *ctx)
    }
 }
 
-
-void cso_set_blend_color(struct cso_context *ctx,
-                         const struct pipe_blend_color *bc)
-{
-   if (memcmp(&ctx->blend_color, bc, sizeof(ctx->blend_color))) {
-      ctx->blend_color = *bc;
-      ctx->pipe->set_blend_color(ctx->pipe, bc);
-   }
-}
-
 void cso_set_sample_mask(struct cso_context *ctx, unsigned sample_mask)
 {
    if (ctx->sample_mask != sample_mask) {
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h
index 3f66ee2b5af..8b856d07426 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.h
+++ b/src/gallium/auxiliary/cso_cache/cso_context.h
@@ -120,10 +120,6 @@ void cso_set_viewport(struct cso_context *cso,
 void cso_set_viewport_dims(struct cso_context *ctx,
                            float width, float height, boolean invert);
 
-
-void cso_set_blend_color(struct cso_context *cso,
-                         const struct pipe_blend_color *bc);
-
 void cso_set_sample_mask(struct cso_context *cso, unsigned stencil_mask);
 
 void cso_set_min_samples(struct cso_context *cso, unsigned min_samples);
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c
index 9aefd6aa5d8..426dc0211a9 100644
--- a/src/mesa/state_tracker/st_atom_blend.c
+++ b/src/mesa/state_tracker/st_atom_blend.c
@@ -303,8 +303,9 @@ st_update_blend( struct st_context *st )
 void
 st_update_blend_color(struct st_context *st)
 {
+   struct pipe_context *pipe = st->pipe;
    struct pipe_blend_color bc;
 
    COPY_4FV(bc.color, st->ctx->Color.BlendColorUnclamped);
-   cso_set_blend_color(st->cso_context, &bc);
+   pipe->set_blend_color(pipe, &bc);
 }



More information about the mesa-commit mailing list