Merge branch 'gallium-msaa'
[mesa.git] / src / gallium / drivers / softpipe / sp_state_surface.c
index bc0e2011300910c1af2a434562d0361f29c595de..2db6faeca465ae838193f20a33f7b4c19f852781 100644 (file)
 
 #include "sp_context.h"
 #include "sp_state.h"
-#include "sp_surface.h"
 #include "sp_tile_cache.h"
 
 #include "draw/draw_context.h"
 
+#include "util/u_format.h"
+#include "util/u_inlines.h"
+
 
 /**
  * XXX this might get moved someday
@@ -49,6 +51,8 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
    struct softpipe_context *sp = softpipe_context(pipe);
    uint i;
 
+   draw_flush(sp->draw);
+
    for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
       /* check if changing cbuf */
       if (sp->framebuffer.cbufs[i] != fb->cbufs[i]) {
@@ -80,8 +84,9 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
       if (sp->framebuffer.zsbuf) {
          int depth_bits;
          double mrd;
-         depth_bits = pf_get_component_bits(sp->framebuffer.zsbuf->format,
-                                            PIPE_FORMAT_COMP_Z);
+         depth_bits = util_format_get_component_bits(sp->framebuffer.zsbuf->format,
+                                                     UTIL_FORMAT_COLORSPACE_ZS,
+                                                     0);
          if (depth_bits > 16) {
             mrd = 0.0000001;
          }