From 32d86eb28aedd01a03ceab746214a8db2a4cbbab Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 16 Aug 2007 18:52:48 +0100 Subject: Rework the GL_READ_BUFFER, GL_DRAW_BUFFER state repairs that Roland previously did. Basically, in update_framebuffer() (which should be called after an FBO is bound with MakeCurrent or BindFramebuffer) we check if the FBO is a window-system FBO. If it is, update the FBO's GL_READ/DRAW_BUFFER state according to the context state. Old code still in place but disabled with #if 0 / #endif. --- src/mesa/main/context.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f3141fe63e..9ee7b4bec7 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1530,6 +1530,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, */ if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { _mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer); +#if 000 /* fix up the fb fields - these will end up wrong otherwise if the DRIdrawable changes, and everything relies on them. This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */ @@ -1539,12 +1540,18 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, buffers[i] = newCtx->Color.DrawBuffer[i]; } _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, buffers, NULL); +#endif } if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) { _mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer); +#if 00 _mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer); +#endif } + /* XXX only set this flag if we're really changing the draw/read + * framebuffer bindings. + */ newCtx->NewState |= _NEW_BUFFERS; #if 1 -- cgit v1.2.3