summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-16 18:52:48 +0100
committerBrian <[email protected]>2007-08-16 18:52:48 +0100
commit32d86eb28aedd01a03ceab746214a8db2a4cbbab (patch)
tree2a6beb7c18ca16070f1e7ed01a89b590c623a92a /src/mesa/main/context.c
parentc033ccc36d08c669dcdfbfc1cf89e472e8211c5f (diff)
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.
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index f3141fe63e8..9ee7b4bec72 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