r600g: consolidate set_blend_color code
authorMarek Olšák <maraeo@gmail.com>
Tue, 14 Feb 2012 14:24:25 +0000 (15:24 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 14 Feb 2012 14:51:59 +0000 (15:51 +0100)
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c

index ce0cec9dd382499987df62ba974c1db38fd14df0..d7d724e8fb34daccb6ef6313632795466383b61b 100644 (file)
@@ -629,26 +629,6 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
        return retval == usage;
 }
 
-static void evergreen_set_blend_color(struct pipe_context *ctx,
-                                       const struct pipe_blend_color *state)
-{
-       struct r600_context *rctx = (struct r600_context *)ctx;
-       struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
-
-       if (rstate == NULL)
-               return;
-
-       rstate->id = R600_PIPE_STATE_BLEND_COLOR;
-       r600_pipe_state_add_reg(rstate, R_028414_CB_BLEND_RED, fui(state->color[0]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_028418_CB_BLEND_GREEN, fui(state->color[1]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_02841C_CB_BLEND_BLUE, fui(state->color[2]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_028420_CB_BLEND_ALPHA, fui(state->color[3]), NULL, 0);
-
-       free(rctx->states[R600_PIPE_STATE_BLEND_COLOR]);
-       rctx->states[R600_PIPE_STATE_BLEND_COLOR] = rstate;
-       r600_context_pipe_state_set(rctx, rstate);
-}
-
 static void *evergreen_create_blend_state(struct pipe_context *ctx,
                                        const struct pipe_blend_state *state)
 {
@@ -1801,7 +1781,7 @@ void evergreen_init_state_functions(struct r600_context *rctx)
        rctx->context.delete_sampler_state = r600_delete_state;
        rctx->context.delete_vertex_elements_state = r600_delete_vertex_element;
        rctx->context.delete_vs_state = r600_delete_vs_shader;
-       rctx->context.set_blend_color = evergreen_set_blend_color;
+       rctx->context.set_blend_color = r600_set_blend_color;
        rctx->context.set_clip_state = evergreen_set_clip_state;
        rctx->context.set_constant_buffer = r600_set_constant_buffer;
        rctx->context.set_fragment_sampler_views = evergreen_set_ps_sampler_view;
index c265809bb454708c84a3cd4dac513e62d1b4c833..a16bf5d410b4d76e184ef55f75f516e787f48bee 100644 (file)
@@ -442,6 +442,8 @@ void *r600_create_vertex_elements(struct pipe_context *ctx,
                                  const struct pipe_vertex_element *elements);
 void r600_delete_vertex_element(struct pipe_context *ctx, void *state);
 void r600_bind_blend_state(struct pipe_context *ctx, void *state);
+void r600_set_blend_color(struct pipe_context *ctx,
+                         const struct pipe_blend_color *state);
 void r600_bind_dsa_state(struct pipe_context *ctx, void *state);
 void r600_bind_rs_state(struct pipe_context *ctx, void *state);
 void r600_delete_rs_state(struct pipe_context *ctx, void *state);
index 4d81cb6df54cef6a23272be9f0d5e8f298a26e37..58d5b1803de96ff2bdadee429bccee58fd283796 100644 (file)
@@ -631,25 +631,6 @@ void r600_polygon_offset_update(struct r600_context *rctx)
        }
 }
 
-static void r600_set_blend_color(struct pipe_context *ctx,
-                                       const struct pipe_blend_color *state)
-{
-       struct r600_context *rctx = (struct r600_context *)ctx;
-       struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
-
-       if (rstate == NULL)
-               return;
-
-       rstate->id = R600_PIPE_STATE_BLEND_COLOR;
-       r600_pipe_state_add_reg(rstate, R_028414_CB_BLEND_RED, fui(state->color[0]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_028418_CB_BLEND_GREEN, fui(state->color[1]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_02841C_CB_BLEND_BLUE, fui(state->color[2]), NULL, 0);
-       r600_pipe_state_add_reg(rstate, R_028420_CB_BLEND_ALPHA, fui(state->color[3]), NULL, 0);
-       free(rctx->states[R600_PIPE_STATE_BLEND_COLOR]);
-       rctx->states[R600_PIPE_STATE_BLEND_COLOR] = rstate;
-       r600_context_pipe_state_set(rctx, rstate);
-}
-
 static void *r600_create_blend_state(struct pipe_context *ctx,
                                        const struct pipe_blend_state *state)
 {
index 1499c43e35fc8c1ece5ba1a4010639456feaeb3f..561e0995afac32d02dff3cca9ce7b4dea7f540a1 100644 (file)
@@ -145,6 +145,26 @@ void r600_bind_blend_state(struct pipe_context *ctx, void *state)
        r600_context_pipe_state_set(rctx, rstate);
 }
 
+void r600_set_blend_color(struct pipe_context *ctx,
+                         const struct pipe_blend_color *state)
+{
+       struct r600_context *rctx = (struct r600_context *)ctx;
+       struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
+
+       if (rstate == NULL)
+               return;
+
+       rstate->id = R600_PIPE_STATE_BLEND_COLOR;
+       r600_pipe_state_add_reg(rstate, R_028414_CB_BLEND_RED, fui(state->color[0]), NULL, 0);
+       r600_pipe_state_add_reg(rstate, R_028418_CB_BLEND_GREEN, fui(state->color[1]), NULL, 0);
+       r600_pipe_state_add_reg(rstate, R_02841C_CB_BLEND_BLUE, fui(state->color[2]), NULL, 0);
+       r600_pipe_state_add_reg(rstate, R_028420_CB_BLEND_ALPHA, fui(state->color[3]), NULL, 0);
+
+       free(rctx->states[R600_PIPE_STATE_BLEND_COLOR]);
+       rctx->states[R600_PIPE_STATE_BLEND_COLOR] = rstate;
+       r600_context_pipe_state_set(rctx, rstate);
+}
+
 static void r600_set_stencil_ref(struct pipe_context *ctx,
                                 const struct r600_stencil_ref *state)
 {