aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-11-08 00:15:50 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:09 -0800
commit64af1d92489767bb51d5bfbee89726558860007e (patch)
tree2c6d459dd4feeaad6544aca542bf0428c14fc771 /src/gallium/drivers/iris/iris_state.c
parent58507c02ce2e36dd6f953a23c3c87a7864a67f54 (diff)
iris: Fix multiple RTs with non-independent blending
rt[i] isn't filled out in this case, so we have to use rt[0]
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r--src/gallium/drivers/iris/iris_state.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 67f8bb782e0..b97266f3ad3 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -812,6 +812,8 @@ iris_create_blend_state(struct pipe_context *ctx,
blend_state += GENX(BLEND_STATE_length);
for (int i = 0; i < BRW_MAX_DRAW_BUFFERS; i++) {
+ const struct pipe_rt_blend_state *rt =
+ &state->rt[state->independent_blend_enable ? i : 0];
iris_pack_state(GENX(BLEND_STATE_ENTRY), blend_state, be) {
be.LogicOpEnable = state->logicop_enable;
be.LogicOpFunction = state->logicop_func;
@@ -821,19 +823,19 @@ iris_create_blend_state(struct pipe_context *ctx,
be.PreBlendColorClampEnable = true;
be.PostBlendColorClampEnable = true;
- be.ColorBufferBlendEnable = state->rt[i].blend_enable;
+ be.ColorBufferBlendEnable = rt->blend_enable;
- be.ColorBlendFunction = state->rt[i].rgb_func;
- be.AlphaBlendFunction = state->rt[i].alpha_func;
- be.SourceBlendFactor = state->rt[i].rgb_src_factor;
- be.SourceAlphaBlendFactor = state->rt[i].alpha_func;
- be.DestinationBlendFactor = state->rt[i].rgb_dst_factor;
- be.DestinationAlphaBlendFactor = state->rt[i].alpha_dst_factor;
+ be.ColorBlendFunction = rt->rgb_func;
+ be.AlphaBlendFunction = rt->alpha_func;
+ be.SourceBlendFactor = rt->rgb_src_factor;
+ be.SourceAlphaBlendFactor = rt->alpha_func;
+ be.DestinationBlendFactor = rt->rgb_dst_factor;
+ be.DestinationAlphaBlendFactor = rt->alpha_dst_factor;
- be.WriteDisableRed = !(state->rt[i].colormask & PIPE_MASK_R);
- be.WriteDisableGreen = !(state->rt[i].colormask & PIPE_MASK_G);
- be.WriteDisableBlue = !(state->rt[i].colormask & PIPE_MASK_B);
- be.WriteDisableAlpha = !(state->rt[i].colormask & PIPE_MASK_A);
+ be.WriteDisableRed = !(rt->colormask & PIPE_MASK_R);
+ be.WriteDisableGreen = !(rt->colormask & PIPE_MASK_G);
+ be.WriteDisableBlue = !(rt->colormask & PIPE_MASK_B);
+ be.WriteDisableAlpha = !(rt->colormask & PIPE_MASK_A);
}
blend_state += GENX(BLEND_STATE_ENTRY_length);
}