summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-07-20 08:40:19 -0600
committerBrian Paul <[email protected]>2010-07-20 08:50:32 -0600
commitbab484a59b21fff84579a492d079d46e27d486dd (patch)
tree537f55a743f40c82fa3c2392965ca2009f347023 /src/mesa/main/teximage.h
parent895086467e03b15d376dcdff0d772408dda03f88 (diff)
mesa: call ctx->Driver.ChooseTextureFormat() only when necessary.
When defining mipmap level 'L' and level L-1 exists and the new level's internalFormat matches level L-1's internalFormat, then use the same hw format. Otherwise, do the regular ctx->Driver.ChooseTextureFormat() call. This avoids a problem where we end up choosing different hw formats for different mipmap levels depending on how the levels are defined (glTexImage vs. glCopyTexImage vs. glGenerateMipmap, etc). The root problem is the ChooseTextureFormat() implementation in some drivers uses the user's glTexImage format/type parameters in the choosing heuristic. Later mipmap levels might be generated with different calls (ex: glCopyTexImage()) so we don't always have format/type info and the driver may choose a different format. For more background info see the July 2010 mesa-dev thread "Bug in _mesa_meta_GenerateMipmap"
Diffstat (limited to 'src/mesa/main/teximage.h')
-rw-r--r--src/mesa/main/teximage.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index d82cc985211..0dcacab3cd0 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -73,6 +73,14 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
extern void
+_mesa_choose_texture_format(GLcontext *ctx,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLenum target, GLint level,
+ GLenum internalFormat, GLenum format, GLenum type);
+
+
+extern void
_mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage);