[Nouveau] [PATCH] Fix glTexSubImage on swizzled surfaces on <=NV40

Luca Barbieri luca at luca-barbieri.com
Tue Dec 29 16:08:55 PST 2009


Currently in nvXX_transfer_new a temporary as large as the surface is created.
If the subrectangle is not the whole texture we would need to read
back the whole texture, but we aren't.
Thus, everything but the subrectangle specified is loaded as garbage.
This can be seen in progs/demos/ray.

This patch fixes the problem by creating a temporary that covers only
the desired subrectangle.

This causes us to hit an alignment assert in nv04_surface_2d.c,.
This is fixed by specifying the start of the surface as the surface
offset, and using the _POINT registers to program the (x, y)
coordinates.
This also allows us to avoid computing swizzled addresses on the CPU.

This fixes progs/demos/ray and doesn't seem to introduce problems.

Patch is for all <=NV40 cards, but tested on NV40 only.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: texsubimage.patch
Type: text/x-diff
Size: 17148 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/nouveau/attachments/20091230/b54543ad/attachment-0001.patch 


More information about the Nouveau mailing list