summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-10 23:22:54 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commitfbfe07c4f373447881fb9da5ca4e060053f7b95c (patch)
tree60cf9c635ee7467ea8ee6aeb3ce212836d05cc6a /src/gallium/drivers/iris/iris_state.c
parent5481887ca82f612f787c4af21134f77bde64db68 (diff)
iris: Track blend enables, save outbound for resolve code
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r--src/gallium/drivers/iris/iris_state.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index e4c95f2e06c..e08f90973f7 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -801,6 +801,9 @@ struct iris_blend_state {
BRW_MAX_DRAW_BUFFERS * GENX(BLEND_STATE_ENTRY_length)];
bool alpha_to_coverage; /* for shader key */
+
+ /** Bitfield of whether blending is enabled for RT[i] - for aux resolves */
+ uint8_t blend_enables;
};
static enum pipe_blendfactor
@@ -829,6 +832,9 @@ iris_create_blend_state(struct pipe_context *ctx,
struct iris_blend_state *cso = malloc(sizeof(struct iris_blend_state));
uint32_t *blend_entry = cso->blend_state + GENX(BLEND_STATE_length);
+ cso->blend_enables = 0;
+ STATIC_ASSERT(BRW_MAX_DRAW_BUFFERS <= 8);
+
cso->alpha_to_coverage = state->alpha_to_coverage;
bool indep_alpha_blend = false;
@@ -850,6 +856,9 @@ iris_create_blend_state(struct pipe_context *ctx,
src_rgb != src_alpha || dst_rgb != dst_alpha)
indep_alpha_blend = true;
+ if (rt->blend_enable)
+ cso->blend_enables |= 1u << i;
+
iris_pack_state(GENX(BLEND_STATE_ENTRY), blend_entry, be) {
be.LogicOpEnable = state->logicop_enable;
be.LogicOpFunction = state->logicop_func;
@@ -916,7 +925,11 @@ static void
iris_bind_blend_state(struct pipe_context *ctx, void *state)
{
struct iris_context *ice = (struct iris_context *) ctx;
- ice->state.cso_blend = state;
+ struct iris_blend_state *cso = state;
+
+ ice->state.cso_blend = cso;
+ ice->state.blend_enables = cso ? cso->blend_enables : 0;
+
ice->state.dirty |= IRIS_DIRTY_PS_BLEND;
ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
ice->state.dirty |= ice->state.dirty_for_nos[IRIS_NOS_BLEND];