Re: Re: [PATCH] Implement software DXT1 compression
An idea that was proposed before was to delegate the conversion (and the patents burden) to the OpenGL drivers, something like using glCompressedTexImage2D() / glGetCompressedTexImage(). Not sure whether there are hidden issues with that approach (except, well, requiring an OpenGL driver with compressed textures support), but at a first glance it doesn't look as something particularly hard to do.
Good idea. This new patch implements this approach. It seems to be working perfectly at least with the nvidia blob. It is also much smaller than the previous one, and doesn't require hacks like inverting colors and so on.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 15.02.2011 um 14:39 schrieb alberto(a)mattea.info:
Good idea. This new patch implements this approach. It seems to be working perfectly at least with the nvidia blob. It is also much smaller than the previous one, and doesn't require hacks like inverting colors and so on.<dxt1.patch> It has one major architectural problem however. You need a GL context, but the SW conversion code cannot use one because it may be called from surface_gdi.c, which works without opengl. There are two ways out:
1) The easy one is to lift this restriction and just handle a context_acquire failure(ok, context_acquire needs some extensions for that). Error handling could just look like FIXME("no gl, bad luck"). But I think that is pretty ugly. 2) Implement the s3tc blits in the opengl blitting code in surface.c. Unfortunately the opengl blitting code is a mess, and adding s3tc blits won't make it better. To allow this we'll need to clean it up first. Rockerick was working on that but dropped the ball because other work interfered. -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iQIcBAEBAgAGBQJNWt+JAAoJEN0/YqbEcdMw17UP/jPtQkMRmTbfBMhgfDTfWNt8 4OgWC73XpMkyR924CcoHoZBQVRLN9ILSApgg8cjyrdsUOPJFoOEIHC/gyIyISbi3 PWtSVAGMTOLv7AkbSR/08pkJyFsGT1gen4HpRmDKRmaAjifiINcAkLhpLSmNOYx7 vFmf7ltknPviaODlOJZS02Lsi1HjGqXL4GaismR4U1oPJUzDAgwi9HeBBp2axrPN mzvnCsIoaZlVGq1SyX8pa3k2WkNLKWHCDwIA4FQFVM+MWoMxLTgxLvo9nuRpyh8F EoCUO68wO77jeKS4N1R4xMSd0ZBpS//V7h4M2MO3Hc1YWA5TJWr6Lo+MhWdMTYD0 ysn2am/Dw69U9ojOWRey4AXDDX3RjekXJzSGIaGPa3/783ThAun5n3E9SCWy/TZf /YZggIG0RckH50d4VWLCarWM3Pp7mF/tIAZSHheqD3r/PBBW/pfE8fDeG6Sw3Tae Mxqmacy+8W/kPVJ/SP+S9DuY2qqKD48YkD+QWn9PUze2NahIdtSTnDH6jn+SC5YJ Zl4ZVGPFLNDMoXN7E3QfWjYntczdzbA8O2jyYNv+45oPGO378OdZcrsEVIJnYi/v VlbMLxnYeE5w+tv0XsqVzDQ9WL9eEjTALO8NWtpQDbCMXE0UJnkJuIrMQxlvXg1y PxT69+lhBXsLlGlprb5+ =fZjK -----END PGP SIGNATURE-----
participants (2)
-
alberto@mattea.info -
Stefan Dösinger