Summary: | [bisected i965]oglc textureNPOT(basic.allCases) segfaults | ||
---|---|---|---|
Product: | Mesa | Reporter: | fangxun <xunx.fang> |
Component: | Drivers/DRI/i965 | Assignee: | Anuj Phogat <anuj.phogat> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | high | CC: | eric |
Version: | git | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 42993 |
Description
fangxun
2011-10-28 02:29:18 UTC
Eric, comments? TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D() with width = 0 and height = 24. Zero image width results in to miptree not allocated for the image. This is due to a condition in function _mesa_store_teximage3d(), src/mesa/main/texstore.c if (width == 0 || height == 0 || depth == 0) return; /* allocate storage for texture data */ if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat, width, height, depth)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); return; } store_texsubimage(ctx, texImage, 0, 0, 0, width, height, depth, format, type, pixels, packing, "glTexImage3D"); Removing the following statements from _mesa_store_teximage3d function resolve the issue: if (width == 0 || height == 0 || depth == 0) return; But i'm not sure if this breaks any other test. I'll send out a patch for review on mesa mailing list. This issue has been resolved by below listed patch: http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg17302.html commit logs on mesa master: commit f1a9a9bcd19dcbb8a0a4bd7299400cb418970f99 Author: Anuj Phogat <anuj.phogat@gmail.com> Date: Mon Jan 16 16:15:30 2012 -0800 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 <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> I see the patch has landed in mesa 8.0 and 7.11 branch. Xun, please verify. Verified with mesa master branch(aed51e3e) and mesa 8.0 branch(65b50085). |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.