Mesa (master): intel: Fix workaround for _mesa_update_framebuffer
Chad Versace
chadversary at kemper.freedesktop.org
Fri Jun 24 21:48:50 UTC 2011
Module: Mesa
Branch: master
Commit: 6062692cc6cd2a88d854b304d9a85bcf4bab0d11
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6062692cc6cd2a88d854b304d9a85bcf4bab0d11
Author: Chad Versace <chad at chad-versace.us>
Date: Thu Jun 23 01:20:19 2011 -0700
intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.
Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.
Signed-off-by: Chad Versace <chad at chad-versace.us>
---
src/mesa/drivers/dri/intel/intel_buffers.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 33f691b..a52a07c 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -105,9 +105,9 @@ intel_draw_buffer(struct gl_context * ctx, struct gl_framebuffer *fb)
/*
* If intel_context is using separate stencil, but the depth attachment
* (gl_framebuffer.Attachment[BUFFER_DEPTH]) has a packed depth/stencil
- * format, then we must install the real depth buffer at
- * gl_framebuffer._DepthBuffer before calling _mesa_update_framebuffer.
- * Otherwise, _mesa_update_framebuffer will create and install a swrast
+ * format, then we must install the real depth buffer at fb->_DepthBuffer
+ * and set fb->_DepthBuffer->Wrapped before calling _mesa_update_framebuffer.
+ * Otherwise, _mesa_update_framebuffer will create and install a swras
* depth wrapper instead.
*
* Ditto for stencil.
@@ -115,11 +115,13 @@ intel_draw_buffer(struct gl_context * ctx, struct gl_framebuffer *fb)
irbDepth = intel_get_renderbuffer(fb, BUFFER_DEPTH);
if (irbDepth && irbDepth->Base.Format == MESA_FORMAT_X8_Z24) {
_mesa_reference_renderbuffer(&fb->_DepthBuffer, &irbDepth->Base);
+ irbDepth->Base.Wrapped = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
}
irbStencil = intel_get_renderbuffer(fb, BUFFER_STENCIL);
if (irbStencil && irbStencil->Base.Format == MESA_FORMAT_S8) {
_mesa_reference_renderbuffer(&fb->_StencilBuffer, &irbStencil->Base);
+ irbStencil->Base.Wrapped = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
}
/* Do this here, not core Mesa, since this function is called from
More information about the mesa-commit
mailing list