nouveau: Fix swizzling for copies to rectangular textures
authorLuca Barbieri <luca@luca-barbieri.com>
Sat, 26 Dec 2009 06:35:17 +0000 (07:35 +0100)
committerYounes Manton <younes.m@gmail.com>
Mon, 28 Dec 2009 22:59:01 +0000 (17:59 -0500)
commitcb9214f33030e1f482d59049c239f20061d24ad8
tree3c9cb08f5e13cf027ec2b89724a39dc7992c1f23
parent3a0c527bd03c0a4e637a1dcde11f0fb6129c07f6
nouveau: Fix swizzling for copies to rectangular textures

nVidia hardware seems to swizzle rectangular texture (with width !=
height) coordinates by swizzling the lower bits and then adding the
higher bits from the larger dimension.
However, nv04_swizzle_bits ignores width and height and just
interleaves everything.
This causes problems with rectangular POT textures with height or
width 2048 or 4096 (but not 2048x1024 where it works by chance) since
the driver swizzles them in 1024x1024 chunks and gets the start
position for the non-first chunks wrong.
The following patch seems to fix those problems.
src/gallium/drivers/nv04/nv04_surface_2d.c