From 7d16e2c0cd70dc5a23b746dbc8e44c58366b5353 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 7 Mar 2011 02:03:52 +0100 Subject: mesa: add EXT_texture_compression_latc The encoding/decoding algorithms are shared with RGTC. Thanks to some magic with the base format, the RGTC texstore functions work for LATC too. swrast passes the related piglit tests besides two things: - The alpha channel is wrong (it's always 1), however the incorrect alpha channel makes some other tests fail too, so I guess it's unrelated to LATC. - Signed LATC fetches aren't correct yet (signed values are clamped to [0,1]), however RGTC has the same problem. Further testing (with other of my patches) shows that hardware drivers and softpipe work. BTW, ETQW uses this extension. --- src/mesa/main/texstore.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/texstore.c') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index cd30fa0214..760cdfa854 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4135,7 +4135,14 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_RED_RGTC1, _mesa_texstore_red_rgtc1 }, { MESA_FORMAT_SIGNED_RED_RGTC1, _mesa_texstore_signed_red_rgtc1 }, { MESA_FORMAT_RG_RGTC2, _mesa_texstore_rg_rgtc2 }, - { MESA_FORMAT_SIGNED_RG_RGTC2, _mesa_texstore_signed_rg_rgtc2 } + { MESA_FORMAT_SIGNED_RG_RGTC2, _mesa_texstore_signed_rg_rgtc2 }, + + /* Re-use the R/RG texstore functions. + * The code is generic enough to handle LATC too. */ + { MESA_FORMAT_L_LATC1, _mesa_texstore_red_rgtc1 }, + { MESA_FORMAT_SIGNED_L_LATC1, _mesa_texstore_signed_red_rgtc1 }, + { MESA_FORMAT_LA_LATC2, _mesa_texstore_rg_rgtc2 }, + { MESA_FORMAT_SIGNED_LA_LATC2, _mesa_texstore_signed_rg_rgtc2 } }; -- cgit v1.2.3