[Mesa-dev] [PATCH 10/15] i965: Mark winsys MSAA color buffer as needing resolve postdraw

Chad Versace chad.versace at linux.intel.com
Sat Jul 21 17:36:49 PDT 2012


Do this immediately after drawing is complete and at the same time that we
mark the depth buffer as needing a depth resolve.

CC: Eric Anholt <eric at anholt.net>
CC: Paul Berry <stereotype441 at gmail.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/i965/brw_draw.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 1069a63..ca44ff8 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -326,18 +326,29 @@ brw_predraw_resolve_buffers(struct brw_context *brw)
  * If the depth buffer was written to and if it has an accompanying HiZ
  * buffer, then mark that it needs a depth resolve.
  *
- * (In the future, this will also mark needed MSAA resolves).
+ * If the color buffer is a multisampled window system buffer, then
+ * mark that it needs a downsample resolve.
  */
 static void brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
 {
    struct gl_context *ctx = &brw->intel.ctx;
    struct gl_framebuffer *fb = ctx->DrawBuffer;
-   struct intel_renderbuffer *depth_irb =
-	 intel_get_renderbuffer(fb, BUFFER_DEPTH);
+
+   gl_buffer_index color_buffer = brw->intel.is_front_buffer_rendering
+                                ? BUFFER_FRONT_LEFT
+                                : BUFFER_BACK_LEFT;
+
+   struct intel_renderbuffer *depth_irb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
+   struct intel_renderbuffer *color_irb = intel_get_renderbuffer(fb, color_buffer);
 
    if (depth_irb && ctx->Depth.Mask) {
       intel_renderbuffer_set_needs_depth_resolve(depth_irb);
    }
+
+   if (color_irb && color_irb->mt->singlesample_mt) {
+      assert(fb->Name == 0);
+      color_irb->mt->need_downsample = true;
+   }
 }
 
 static int
-- 
1.7.11.2



More information about the mesa-dev mailing list