From: Ian Romanick Date: Thu, 23 Aug 2012 01:53:42 +0000 (-0700) Subject: meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2abf555496b8f5a7319542756508dd2f2e8ed07c;p=mesa.git meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist This is a bit of a hack. _mesa_meta_GenerateMipmap shouldn't even be used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core profile and ES2) because it uses fixed-function, and fixed-function doesn't exist there either! A GLSL-based _mesa_meta_GenerateMipmap should be available soon. When that is available, this patch will be irrelevant and should be reverted. v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review comment from Brian Paul. Signed-off-by: Ian Romanick Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index db49d90ea6d..7d7113c5623 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3010,7 +3010,10 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); - _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + else + assert(!genMipmapSave); if (ctx->Extensions.EXT_framebuffer_sRGB) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE); @@ -3149,7 +3152,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_meta_end(ctx); _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); - _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); + if (genMipmapSave) + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); }