diff options
author | Chad Versace <[email protected]> | 2011-11-15 18:20:43 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2011-11-22 10:50:51 -0800 |
commit | 1b2baf3b08d545c772e9636fb0a0614c489c3916 (patch) | |
tree | 90d0692019e229ca95c93cf30ad136ffb3a6d6c1 /src/mesa/drivers | |
parent | 622bae07a5da91bc966d173fd6df92a640e4f574 (diff) |
i965: Mark that depth buffer needs depth resolve after drawing
After brw_try_draw_prims() emits a batch, mark that the depth buffer needs
a depth resolve if the buffer was written to and if it has an accompanying
HiZ buffer.
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 35196a7e1a0..bf3c95cbebc 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -355,6 +355,28 @@ brw_predraw_resolve_buffers(struct brw_context *brw) } } +/** + * \brief Call this after drawing to mark which buffers need resolving + * + * 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). + */ +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); + + if (depth_irb && + ctx->Depth.Mask && + !brw->hiz.op) { + intel_renderbuffer_set_needs_depth_resolve(depth_irb); + } +} + /* May fail if out of video memory for texture or vbo upload, or on * fallback conditions. */ @@ -483,6 +505,7 @@ retry: out: brw_state_cache_check_size(brw); + brw_postdraw_set_buffers_need_resolve(brw); return retval; } |