[PATCH] Implement software DXT1 compression
This patch adds conversion functions from WINED3DFMT_B8G8R8_UNORM, WINED3DFMT_B5G5R5A1_UNORM and WINED3DFMT_B5G5R5X1_UNORM to WINED3DFMT_DXT1. It uses code slighty modified from libtxc_dxtn. It fixes at least LEGO Stunt Rally, probably other games too. I didn't implement dxt3 and dxt5 since I haven't got any apps to test, but if someone has similar problems (black textures) with them and wants to test, let me know, and I will add them as well. I would also like some feedback about the patent situation, e.g. if the patch can be mainlined as it is or if it would be better to load libtxc_dxtn directly at runtime. Alberto
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 14.02.2011 um 16:50 schrieb alberto(a)mattea.info:
I would also like some feedback about the patent situation, e.g. if the patch can be mainlined as it is or if it would be better to load libtxc_dxtn directly at runtime. I'm afraid neither solution is entirely satisfactory. I recommend to take a look at the Nvidia Texture tools. This is a BSD-licensed(I think) library(+ callable programs) for which Nvidia has licensed the S3TC patent. So if we dynamically link to this library and use it we should be in the clear.
The library behind nv texture tools is C++, but it does have C bindings. libtxc_dxtn has at least some decompression bugs, some games like gothic 2 didn't render properly with it. (When using the S3tc->ARGB8 sw decompression path of gothic 2. With HW dxtn the game doesn't use SW decompression) -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iQIcBAEBAgAGBQJNWXkXAAoJEN0/YqbEcdMwxWsQAIkF62VJ0CxrVS3UWhXmqf8n UHKyDdrQr4e2EybZL8Q8EptYQO5hjvWuABgyZcrRpwXo11edNB5rcOVpyAcHimxz 0DH2X5q06KmlExmEKx2+8ePS5B8yTxoXDSfFKDF2Kb+f28X3IT6w+nE0iFyUv2nU aioO6ad8z+3EjzLSiY3zMYls5KMH3a41gSfEzvzHi/W3HtlWE1oJ6zg4Ep+/EgAd 5AXsp7GAjjJxjl+LGTBCwQyREZ07+Qbyra7ne1MZvZjgYe2M74q16QXf7mZ16/OH NUe4dq3Deyq/wXaPbh6xTau6GSQPJztZif/Tg0eryD/Vlated5fA7a75sLqVNeCH nhu80jjBeGJv+l6dEeLLnXnYRE08+Fdalzbii2uc+jiJlYXuhQdKSc0GcXRWl4U/ TvYwYe/yh84UlhBLAWGcwxZG4SXGRuGR6DyFPAYfjzg7Y5JPrrJYjjLyOAAeza4K e4b4enBqB4IYj66RU8a7eaOv+g2VRXaeb/HIAEd6DgpvN05Qs8k0MUGvZCGQy5uM W0FzWGaDLvGL8V+vchMWrYN925nJqFLGRpGPcOahvqMA9IdRXVMqy62Ohx7NLa3h vPOp8zPg//xAoEzBE3j0Z1Xy1pNKvcPSuG3uMpYqnH0qsuSbO/JtCAA2hel47EfQ fOScjJoppTUon/mbYl85 =ehwC -----END PGP SIGNATURE-----
I haven't investigated very closely, but my impression is that you want to use libsquish. I'm not sure if it has C bindings, or if the API is entirely right for what we need, but maybe they accept patches.
participants (3)
-
alberto@mattea.info -
Henri Verbeet -
Stefan Dösinger