summaryrefslogtreecommitdiff
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 255023c0fa..2ad1badac7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -97,12 +97,9 @@
#include "fog.h"
#include "framebuffer.h"
#include "get.h"
-#include "glthread.h"
-#include "glapioffsets.h"
#include "histogram.h"
#include "hint.h"
#include "hash.h"
-#include "atifragshader.h"
#include "light.h"
#include "lines.h"
#include "macros.h"
@@ -110,9 +107,6 @@
#include "pixel.h"
#include "points.h"
#include "polygon.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
-#include "program.h"
-#endif
#include "queryobj.h"
#include "rastpos.h"
#include "simple_list.h"
@@ -126,13 +120,19 @@
#include "varray.h"
#include "version.h"
#include "vtxfmt.h"
+#include "glapi/glthread.h"
+#include "glapi/glapioffsets.h"
+#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#include "shader/program.h"
+#endif
+#include "shader/shader_api.h"
+#include "shader/atifragshader.h"
#if _HAVE_FULL_GL
#include "math/m_translate.h"
#include "math/m_matrix.h"
#include "math/m_xform.h"
#include "math/mathmod.h"
#endif
-#include "shader_api.h"
#ifdef USE_SPARC_ASM
#include "sparc/sparc.h"
@@ -1495,9 +1495,20 @@ _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!?! */
+ int i;
+ GLenum buffers[MAX_DRAW_BUFFERS];
+ for(i = 0; i < newCtx->Const.MaxDrawBuffers; i++) {
+ buffers[i] = newCtx->Color.DrawBuffer[i];
+ }
+ _mesa_drawbuffers(newCtx, newCtx->Const.MaxDrawBuffers, buffers, NULL);
}
if (!newCtx->ReadBuffer || newCtx->ReadBuffer->Name == 0) {
_mesa_reference_framebuffer(&newCtx->ReadBuffer, readBuffer);
+ _mesa_ReadBuffer(newCtx->Pixel.ReadBuffer);
}
newCtx->NewState |= _NEW_BUFFERS;