aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-26 12:48:28 +0200
committermarha <marha@users.sourceforge.net>2011-07-26 12:48:28 +0200
commitdc23661fa1d58aa98d67fae47a919de452b8cd28 (patch)
tree0a8c7987f3756290e3ba9cfb8cdf23d6e9532037 /mesalib/src/mesa/main/texparam.c
parent8680f93ff96770b0a022596d8d4092a29c586435 (diff)
parentece07bdeaa82ea59e74bcfc588bcabe5e47567c1 (diff)
downloadvcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.tar.gz
vcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.tar.bz2
vcxsrv-dc23661fa1d58aa98d67fae47a919de452b8cd28.zip
Merge remote-tracking branch 'origin/released'
Conflicts: libX11/specs/libX11/CH11.xml mesalib/src/glsl/main.cpp mesalib/src/mesa/main/compiler.h mesalib/src/mesa/main/get.c mesalib/src/mesa/main/texcompress.c mesalib/src/mesa/main/texparam.c mesalib/src/mesa/program/ir_to_mesa.cpp mesalib/src/mesa/program/prog_optimize.c pixman/pixman/pixman-fast-path.c pixman/pixman/pixman-fast-path.h xorg-server/hw/xquartz/GL/indirect.c xorg-server/hw/xquartz/X11Application.h xorg-server/hw/xquartz/X11Application.m xorg-server/hw/xquartz/bundle/Resources/French.lproj/locversion.plist xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/designable.nib xorg-server/hw/xquartz/bundle/Resources/German.lproj/locversion.plist xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/designable.nib xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/locversion.plist xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/designable.nib xorg-server/hw/xquartz/darwinEvents.c xorg-server/hw/xquartz/darwinEvents.h xorg-server/hw/xquartz/man/Xquartz.man xorg-server/hw/xquartz/xpr/dri.c xorg-server/xkeyboard-config/symbols/ee
Diffstat (limited to 'mesalib/src/mesa/main/texparam.c')
-rw-r--r--mesalib/src/mesa/main/texparam.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c
index 545c44ab9..f62745770 100644
--- a/mesalib/src/mesa/main/texparam.c
+++ b/mesalib/src/mesa/main/texparam.c
@@ -915,9 +915,23 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = _mesa_compressed_format_to_glenum(ctx, texFormat);
}
else {
- /* return the user's requested internal format */
- *params = img->InternalFormat;
- }
+ /* If the true internal format is not compressed but the user
+ * requested a generic compressed format, we have to return the
+ * generic base format that matches.
+ *
+ * From page 119 (page 129 of the PDF) of the OpenGL 1.3 spec:
+ *
+ * "If no specific compressed format is available,
+ * internalformat is instead replaced by the corresponding base
+ * internal format."
+ *
+ * Otherwise just return the user's requested internal format
+ */
+ const GLenum f =
+ _mesa_gl_compressed_format_base_format(img->InternalFormat);
+
+ *params = (f != 0) ? f : img->InternalFormat;
+ }
break;
case GL_TEXTURE_BORDER:
*params = img->Border;