Luca Barbieri
2009-Dec-30 00:08 UTC
[Nouveau] [PATCH] Fix glTexSubImage on swizzled surfaces on <=NV40
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
Luca Barbieri
2009-Dec-30 00:44 UTC
[Nouveau] [PATCH] Fix glTexSubImage on swizzled surfaces on <=NV40
Ignore that patch. It's broken because we must set the offset for the up to 1024x1024 chunk we are copying instead of the whole image. The corrected patch is attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: texsubimage.patch Type: text/x-diff Size: 17327 bytes Desc: not available Url : http://lists.freedesktop.org/archives/nouveau/attachments/20091230/4d196db4/attachment.patch
Luca Barbieri
2009-Dec-30 01:54 UTC
[Nouveau] [PATCH] Fix glTexSubImage on swizzled surfaces on <=NV40
Third attempt, as the second one was logically wrong. The problem in the first patch was actually that the source point register has a 1024 limit. This one leaves the way the source is set up alone, and sets the whole surface as the destination like in the first version, using the point registers (which do not seem to have a 1024 limit, but only on the destination). Needs testing on <NV40. -------------- next part -------------- A non-text attachment was scrubbed... Name: texsubimage.patch Type: text/x-diff Size: 16561 bytes Desc: not available Url : http://lists.freedesktop.org/archives/nouveau/attachments/20091230/14055f0f/attachment-0001.patch
Possibly Parallel Threads
- [Bug 110500] New: X-Server crashes - GL error: GL_OUT_OF_MEMORY in glTexSubImage
- [WIP PATCH] dri/nouveau: Add S3TC support for nv20.
- [PATCH] nouveau_vieux: add AllocTextureImageBuffer implementation
- 8-bit swizzled textures
- [virtio-dev] [PATCH 2/2] virtio-gpu/2d: add docs/specs/virtio-gpu.txt