diff options
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b132030b9b1..f42a566c302 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -535,6 +535,7 @@ _mesa_init_constants(struct gl_context *ctx) assert(ctx); /* Constants, may be overriden (usually only reduced) by device drivers */ + ctx->Const.MaxTextureMbytes = MAX_TEXTURE_MBYTES; ctx->Const.MaxTextureLevels = MAX_TEXTURE_LEVELS; ctx->Const.Max3DTextureLevels = MAX_3D_TEXTURE_LEVELS; ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS; @@ -1399,6 +1400,8 @@ _mesa_make_current( struct gl_context *newCtx, struct gl_framebuffer *drawBuffer, struct gl_framebuffer *readBuffer ) { + GET_CURRENT_CONTEXT(curCtx); + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(newCtx, "_mesa_make_current()\n"); @@ -1419,6 +1422,11 @@ _mesa_make_current( struct gl_context *newCtx, } } + if (curCtx && + (curCtx->WinSysDrawBuffer || curCtx->WinSysReadBuffer) && /* make sure this context is valid for flushing */ + curCtx != newCtx) + _mesa_flush(curCtx); + /* We used to call _glapi_check_multithread() here. Now do it in drivers */ _glapi_set_context((void *) newCtx); ASSERT(_mesa_get_current_context() == newCtx); @@ -1822,7 +1830,7 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where) #ifdef DEBUG if (ctx->Shader.Flags & GLSL_LOG) { struct gl_shader_program *shProg[MESA_SHADER_TYPES]; - unsigned i; + gl_shader_type i; shProg[MESA_SHADER_VERTEX] = ctx->Shader.CurrentVertexProgram; shProg[MESA_SHADER_GEOMETRY] = ctx->Shader.CurrentGeometryProgram; |