mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.
authorEric Anholt <eric@anholt.net>
Fri, 10 Jun 2011 19:58:56 +0000 (12:58 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 14 Jun 2011 18:17:39 +0000 (11:17 -0700)
commit10e418f3815d690b2526e835bc7eb421b6be7050
tree982da3af4c97148dfdff2ad2e2442ae4d1b9b2a1
parentb0c4db68b2bea1d41ba42211a3ff6b41dfee21a8
mesa: Switch generate_mipmaps_compressed() to using TexImage2D to upload.

The code was playing fast and loose with rowstrides, which meant that
if a driver chose anything different for its alignment requirements,
the generated mipmaps came out garbage.  Unlike the uncompressed case,
we can't generate mipmaps directly into image->Data, so by using
TexImage2D we cut out most of the weird logic that existed to generate
in-place into ->Data.  The up/downside is that the driver recovery
code for the fact that _mesa_generate_mipmaps whacked ->Data has to be
turned off for compressed now.

Fixes 6 piglit tests about compressed mipmap gen.
src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/nouveau/nouveau_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/main/mipmap.c