From 6062692cc6cd2a88d854b304d9a85bcf4bab0d11 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Thu, 23 Jun 2011 01:20:19 -0700 Subject: [PATCH] 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 --- src/mesa/drivers/dri/intel/intel_buffers.c | 8 +++++--- 1 file 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 33f691bf5f3..a52a07cd93a 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 -- 2.30.2