summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-07-17 14:31:57 +0200
committerChristian König <[email protected]>2012-07-24 12:29:29 +0200
commit0a091a48242513e53a99976239405e8cb72d96be (patch)
tree32323cc457d92d99ae618c5e3796eb1f76697dbc /src/gallium/drivers/radeonsi/si_state.c
parent63636ae52aefc275115d1f3daac4e75285583485 (diff)
radeonsi: move blend color to new state handling
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 8373f423685..51ee5c593d0 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -176,9 +176,27 @@ static void si_delete_blend_state(struct pipe_context *ctx, void *state)
si_pm4_delete_state(rctx, blend, (struct si_state_blend *)state);
}
+static void si_set_blend_color(struct pipe_context *ctx,
+ const struct pipe_blend_color *state)
+{
+ struct r600_context *rctx = (struct r600_context *)ctx;
+ struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
+
+ if (pm4 == NULL)
+ return;
+
+ si_pm4_set_reg(pm4, R_028414_CB_BLEND_RED, fui(state->color[0]));
+ si_pm4_set_reg(pm4, R_028418_CB_BLEND_GREEN, fui(state->color[1]));
+ si_pm4_set_reg(pm4, R_02841C_CB_BLEND_BLUE, fui(state->color[2]));
+ si_pm4_set_reg(pm4, R_028420_CB_BLEND_ALPHA, fui(state->color[3]));
+
+ si_pm4_set_state(rctx, blend_color, pm4);
+}
+
void si_init_state_functions(struct r600_context *rctx)
{
rctx->context.create_blend_state = si_create_blend_state;
rctx->context.bind_blend_state = si_bind_blend_state;
rctx->context.delete_blend_state = si_delete_blend_state;
+ rctx->context.set_blend_color = si_set_blend_color;
}