aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-04 09:28:39 +0100
committermarha <marha@users.sourceforge.net>2011-11-04 09:28:39 +0100
commit23e2767dc3e6b8891d4b55b711c70c6bc85a6f85 (patch)
tree04c538697c3afbd401afb1bb614460b16be28844 /mesalib/src/mesa/main/texgetimage.c
parent125500b44d0253d7fd7a59905ab730151d4f66e2 (diff)
parent02f377d5e2dd18537d0807ad63675a0970b5a37d (diff)
downloadvcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.tar.gz
vcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.tar.bz2
vcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winglobals.c xorg-server/hw/xwin/winmonitors.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winwin32rootlesswndproc.c xorg-server/include/scrnintstr.h xorg-server/xkb/ddxList.c xorg-server/xkb/ddxLoad.c
Diffstat (limited to 'mesalib/src/mesa/main/texgetimage.c')
-rw-r--r--mesalib/src/mesa/main/texgetimage.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 06e032396..31d49f2d8 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -50,7 +50,7 @@
* Can the given type represent negative values?
*/
static inline GLboolean
-type_with_negative_values(GLenum type)
+type_needs_clamping(GLenum type)
{
switch (type) {
case GL_BYTE:
@@ -58,9 +58,11 @@ type_with_negative_values(GLenum type)
case GL_INT:
case GL_FLOAT:
case GL_HALF_FLOAT_ARB:
- return GL_TRUE;
- default:
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
return GL_FALSE;
+ default:
+ return GL_TRUE;
}
}
@@ -219,7 +221,7 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions,
/* In general, clamping does not apply to glGetTexImage, except when
* the returned type of the image can't hold negative values.
*/
- if (!type_with_negative_values(type)) {
+ if (type_needs_clamping(type)) {
/* the returned image type can't have negative values */
if (dataType == GL_FLOAT ||
dataType == GL_SIGNED_NORMALIZED ||
@@ -849,6 +851,7 @@ getcompressedteximage_error_check(struct gl_context *ctx, GLenum target,
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetnCompressedTexImageARB(out of bounds access:"
" bufSize (%d) is too small)", clientMemSize);
+ return GL_TRUE;
}
} else {
/* do bounds checking on PBO write */