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@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)
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.