summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2015-09-20 01:33:17 +0200
committerRoland Scheidegger <sroland@vmware.com>2015-09-25 00:06:10 +0200
commit19604d30e1351868f7f54847c91ffec7b3fcd27e (patch)
treedbc10d4cb3f2bba4ff02682571ad80d8947136a7 /src/mesa/main/api_validate.c
parentd6bb46bbe8e4ef90dedc5a04c7434a8113c10a8b (diff)
downloadexternal_mesa3d-19604d30e1351868f7f54847c91ffec7b3fcd27e.zip
external_mesa3d-19604d30e1351868f7f54847c91ffec7b3fcd27e.tar.gz
external_mesa3d-19604d30e1351868f7f54847c91ffec7b3fcd27e.tar.bz2
mesa: fix mipmap generation for immutable, compressed textures
If the immutable compressed texture didn't have the full mip pyramid, this didn't work, because it tried to generate mip levels for non-existing levels. _mesa_prepare_mipmap_level() would correctly handle this by returning FALSE if the mip level didn't exist, however we actually created the non-existing mip level right before that because we used _mesa_get_tex_image() before calling _mesa_prepare_mipmap_level(). It would then proceed to crash (we allocated the mip level, which is a bad idea on an immutable texture, but didn't initialize the values, leading to assertion failures or segfaults). Fix this by using _mesa_select_tex_image() instead and call it after _mesa_prepare_mipmap_level(), as that function will allocate missing mip levels for non-immutable textures already. This fixes a (2 year old) crash with astromenace which was hack-fixed in ubuntu packages instead: http://bugs.debian.org/718680 (I guess most apps do full mip chains - I believe this app not doing it is actually unintentional, always one level less than full mip chain...). Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/api_validate.c')
0 files changed, 0 insertions, 0 deletions