Merge branch '7.8'
[mesa.git] / src / gallium / drivers / softpipe / sp_state_blend.c
index efed082f823f05d8c383a933d642b0a517af7b84..c63a49e90b0ac99d3669b3ced7092059cb921c92 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #include "util/u_memory.h"
+#include "draw/draw_context.h"
 #include "sp_context.h"
 #include "sp_state.h"
 
@@ -45,6 +46,8 @@ void softpipe_bind_blend_state( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
+   draw_flush(softpipe->draw);
+
    softpipe->blend = (struct pipe_blend_state *)blend;
 
    softpipe->dirty |= SP_NEW_BLEND;
@@ -58,10 +61,12 @@ void softpipe_delete_blend_state(struct pipe_context *pipe,
 
 
 void softpipe_set_blend_color( struct pipe_context *pipe,
-                            const struct pipe_blend_color *blend_color )
+                               const struct pipe_blend_color *blend_color )
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
+   draw_flush(softpipe->draw);
+
    softpipe->blend_color = *blend_color;
 
    softpipe->dirty |= SP_NEW_BLEND;
@@ -75,7 +80,7 @@ void softpipe_set_blend_color( struct pipe_context *pipe,
 
 void *
 softpipe_create_depth_stencil_state(struct pipe_context *pipe,
-                                   const struct pipe_depth_stencil_alpha_state *depth_stencil)
+                                    const struct pipe_depth_stencil_alpha_state *depth_stencil)
 {
    return mem_dup(depth_stencil, sizeof(*depth_stencil));
 }
@@ -96,3 +101,13 @@ softpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
 {
    FREE( depth );
 }
+
+void softpipe_set_stencil_ref( struct pipe_context *pipe,
+                               const struct pipe_stencil_ref *stencil_ref )
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
+
+   softpipe->stencil_ref = *stencil_ref;
+
+   softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
+}