summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2007-07-18 20:17:14 +0200
committerRoland Scheidegger <[email protected]>2007-07-18 20:17:14 +0200
commit131a03631208afb1fce90292eb27115511f58257 (patch)
tree784a3d383170b08e45011a343e3a3ab788643a5b /src/mesa/main/context.c
parent3f318c2eb98cf7216ae7033806fa764ac40192bf (diff)
fix mesa's handling of fbo's / window fb (again)
Make sure the relevant fields in window fbs get updated at appropriate time (those are NOT the same as fbos!!!), and fix up related code accordingly. This is a bit ugly, but there's a reason the issues section in EXT_fbo is a couple hundred pages long... Hopefully correct now.
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 5239e739568..92d8ceda292 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1496,14 +1496,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->DrawBuffer, drawBuffer);
/* fix up the fb fields - these will end up wrong otherwise
- if the DRIdrawable changes, and someone may rely on them.
- */
- /* What a mess!?! */
- /* XXX this is still not quite correct. Imagine a user-created fbo
- bound on a context. Now rebind with a completely new drawable.
- Upon rebinding to the window-framebuffer, we have no idea what
- the read and write buffers should be (front, back, ...) - that
- information was only available in the previously used drawable... */
+ if the DRIdrawable changes, and everything relies on them.
+ This is a bit messy (same as needed in _mesa_BindFramebufferEXT) */
int i;
GLenum buffers[MAX_DRAW_BUFFERS];
for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
@@ -1513,7 +1507,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
}
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
- _mesa_ReadBuffer(newCtx->Pixel.ReadBuffer);
+ _mesa_readbuffer_update_fields(newCtx, newCtx->Pixel.ReadBuffer);
}
newCtx->NewState |= _NEW_BUFFERS;