Module: Mesa Branch: master Commit: de7e3741ebca9fb794b890e00b5fed5b2bbb62a2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=de7e3741ebca9fb794b890e00b5fed5b2bbb62a2
Author: Mikko Juola <[email protected]> Date: Tue Jul 30 06:19:59 2013 +0300 mesa: fix number of mipmaps calculation for proxy textures The function _mesa_get_tex_max_num_levels() is supposed to calculate the number of mipmap levels but it was not written to handle proxy textures, at best returning a maximum of 1 mipmap level. Because of this, at least glTexStorage*() calls would incorrectly fail when used with proxy textures with more than one mipmap level. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected] --- src/mesa/main/teximage.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 1118496..b719fc8 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1097,24 +1097,34 @@ _mesa_get_tex_max_num_levels(GLenum target, GLsizei width, GLsizei height, switch (target) { case GL_TEXTURE_1D: case GL_TEXTURE_1D_ARRAY: + case GL_PROXY_TEXTURE_1D: + case GL_PROXY_TEXTURE_1D_ARRAY: size = width; break; case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: ASSERT(width == height); size = width; break; case GL_TEXTURE_2D: case GL_TEXTURE_2D_ARRAY: + case GL_PROXY_TEXTURE_2D: + case GL_PROXY_TEXTURE_2D_ARRAY: size = MAX2(width, height); break; case GL_TEXTURE_3D: + case GL_PROXY_TEXTURE_3D: size = MAX3(width, height, depth); break; case GL_TEXTURE_RECTANGLE: case GL_TEXTURE_EXTERNAL_OES: case GL_TEXTURE_2D_MULTISAMPLE: case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + case GL_PROXY_TEXTURE_RECTANGLE: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: return 1; default: assert(0); _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
