[Mesa-dev] [PATCH 08/16] i965: Mark needed downsamples for msaa winsys buffers
Chad Versace
chad.versace at linux.intel.com
Thu Aug 2 18:39:51 PDT 2012
Do this at two locations:
- Immediately after drawing is complete.
- After blitting.
v2:
- Mark the front buffer too, per Paul.
- Mark after blitting, per Paul.
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_blorp_blit.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_draw.c | 20 +++++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 1206237..850d0e5 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -147,8 +147,8 @@ do_blorp_blit(struct intel_context *intel, GLbitfield buffer_bit,
mirror_x, mirror_y);
brw_blorp_exec(intel, ¶ms);
- /* Mark the dst buffer as needing a HiZ resolve if necessary. */
intel_renderbuffer_set_needs_hiz_resolve(intel_renderbuffer(dst_rb));
+ intel_renderbuffer_set_needs_downsample(intel_renderbuffer(dst_rb));
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 1069a63..ccfc306 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -326,18 +326,28 @@ 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 multisample window system buffer, then
+ * mark that it needs a downsample.
*/
static void brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
{
+ struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &brw->intel.ctx;
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct intel_renderbuffer *depth_irb =
- intel_get_renderbuffer(fb, BUFFER_DEPTH);
- if (depth_irb && ctx->Depth.Mask) {
+ struct intel_renderbuffer *front_irb = NULL;
+ struct intel_renderbuffer *back_irb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
+ struct intel_renderbuffer *depth_irb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
+
+ if (intel->is_front_buffer_rendering)
+ front_irb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+
+ if (front_irb)
+ intel_renderbuffer_set_needs_downsample(front_irb);
+ if (back_irb)
+ intel_renderbuffer_set_needs_downsample(back_irb);
+ if (depth_irb && ctx->Depth.Mask)
intel_renderbuffer_set_needs_depth_resolve(depth_irb);
- }
}
static int
--
1.7.11.4
More information about the mesa-dev
mailing list