void (*set_blend_state)( struct pipe_context *,
const struct pipe_blend_state * );
+ void (*set_blend_color)( struct pipe_context *,
+ const struct pipe_blend_color * );
+
void (*set_clip_state)( struct pipe_context *,
const struct pipe_clip_state * );
softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
softpipe->pipe.set_alpha_test_state = softpipe_set_alpha_test_state;
softpipe->pipe.set_blend_state = softpipe_set_blend_state;
+ softpipe->pipe.set_blend_color = softpipe_set_blend_color;
softpipe->pipe.set_clip_state = softpipe_set_clip_state;
softpipe->pipe.set_clear_color_state = softpipe_set_clear_color_state;
softpipe->pipe.set_depth_state = softpipe_set_depth_test_state;
void softpipe_set_blend_state( struct pipe_context *,
const struct pipe_blend_state * );
+void softpipe_set_blend_color( struct pipe_context *pipe,
+ const struct pipe_blend_color *blend_color );
+
void softpipe_set_clear_color_state( struct pipe_context *,
const struct pipe_clear_color_state * );
}
+void softpipe_set_blend_color( struct pipe_context *pipe,
+ const struct pipe_blend_color *blend_color )
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+
+ softpipe->blend_color = *blend_color;
+
+ softpipe->dirty |= G_NEW_BLEND;
+}
+
+
/** XXX move someday? Or consolidate all these simple state setters
* into one file.
*/
st->state.blend = blend; /* struct copy */
st->pipe->set_blend_state(st->pipe, &blend); /* set new state */
}
+
+ if (memcmp(st->ctx->Color.BlendColor, &st->state.blend_color, 4 * sizeof(GLfloat)) != 0) {
+ /* state has changed */
+ st->state.blend_color.color[0] = st->ctx->Color.BlendColor[0];
+ st->state.blend_color.color[1] = st->ctx->Color.BlendColor[1];
+ st->state.blend_color.color[2] = st->ctx->Color.BlendColor[2];
+ st->state.blend_color.color[3] = st->ctx->Color.BlendColor[3];
+ st->pipe->set_blend_color(st->pipe, (struct pipe_blend_color *) st->ctx->Color.BlendColor);
+ }
}
struct {
struct pipe_alpha_test_state alpha_test;
struct pipe_blend_state blend;
+ struct pipe_blend_color blend_color;
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
struct pipe_depth_state depth;