struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_blend *blend = CALLOC_STRUCT(r600_pipe_blend);
struct r600_pipe_state *rstate;
- uint32_t color_control, target_mask;
+ uint32_t color_control = 0, target_mask;
/* XXX there is more then 8 framebuffer */
unsigned blend_cntl[8];
rstate->id = R600_PIPE_STATE_BLEND;
target_mask = 0;
- color_control = S_028808_MODE(1);
if (state->logicop_enable) {
color_control |= (state->logicop_func << 16) | (state->logicop_func << 20);
} else {
}
}
blend->cb_target_mask = target_mask;
-
+
+ if (target_mask)
+ color_control |= S_028808_MODE(V_028808_CB_NORMAL);
+ else
+ color_control |= S_028808_MODE(V_028808_CB_DISABLE);
+
r600_pipe_state_add_reg(rstate, R_028808_CB_COLOR_CONTROL,
color_control);
/* only have dual source on MRT0 */
#define S_028808_MODE(x) (((x) & 0x7) << 4)
#define G_028808_MODE(x) (((x) >> 4) & 0x7)
#define C_028808_MODE 0xFFFFFF8F
+#define V_028808_CB_DISABLE 0
+#define V_028808_CB_NORMAL 1
#define S_028808_ROP3(x) (((x) & 0xFF) << 16)
#define G_028808_ROP3(x) (((x) >> 16) & 0xFF)
#define C_028808_ROP3 0xFF00FFFF
target_mask |= (state->rt[0].colormask << (4 * i));
}
}
+
+ if (target_mask)
+ color_control |= S_028808_SPECIAL_OP(V_028808_NORMAL);
+ else
+ color_control |= S_028808_SPECIAL_OP(V_028808_DISABLE);
+
blend->cb_target_mask = target_mask;
blend->cb_color_control = color_control;
/* only MRT0 has dual src blend */
#define G_028808_DEGAMMA_ENABLE(x) (((x) >> 3) & 0x1)
#define C_028808_DEGAMMA_ENABLE 0xFFFFFFF7
#define S_028808_SPECIAL_OP(x) (((x) & 0x7) << 4)
+#define V_028808_NORMAL 0
+#define V_028808_DISABLE 1
#define G_028808_SPECIAL_OP(x) (((x) >> 4) & 0x7)
#define C_028808_SPECIAL_OP 0xFFFFFF8F
#define S_028808_PER_MRT_BLEND(x) (((x) & 0x1) << 7)