summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-12-03 13:38:34 -0500
committerMarge Bot <eric+marge@anholt.net>2020-12-22 12:01:38 +0000
commita35014954b0257a8c520ab8d9a234324ec6be6cc (patch)
tree3296521a171536234cbbc81aae0ceddb0909eefe
parent912ba743b5e48cb5722814a792b8d26085bf4c46 (diff)
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@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c11
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.h4
-rw-r--r--src/mesa/state_tracker/st_atom_blend.c3
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);
}