summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.h
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2012-01-16 16:15:30 -0800
committerAnuj Phogat <[email protected]>2012-01-17 15:14:44 -0800
commitf1a9a9bcd19dcbb8a0a4bd7299400cb418970f99 (patch)
tree1c7e37e38898a2633ae197c5bf0ba5d026004acc /src/mesa/main/teximage.h
parent94556f359450acebe87d6c9b4f4fd8ccf78589d8 (diff)
mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D() with width = 0. Texture with zero size skips miptree allocation due to a condition in function _mesa_store_teximage3d(). While calling glGetTexImage() it results in assertion failure in intel_map_texture_image() due to null mt pointer. This patch fixes the issue by detecting the zero size texture early in glGetTexImage and glGetCompressedTexImage functions. In such a case function simply returns doing nothing. Verified that below mentioned bug is fixed by this patch. https://bugs.freedesktop.org/show_bug.cgi?id=42334 NOTE: This is a candidate for stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.h')
-rw-r--r--src/mesa/main/teximage.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 12af0e6d6d5..e2bdaca0150 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -44,7 +44,14 @@ _mesa_is_cube_face(GLenum target)
target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);
}
-
+/** Is any of the dimensions of given texture equal to zero? */
+static inline GLboolean
+_mesa_is_zero_size_texture(const struct gl_texture_image *texImage)
+{
+ return (texImage->Width == 0 ||
+ texImage->Height == 0 ||
+ texImage->Depth == 0);
+}
/** \name Internal functions */
/*@{*/