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/mipmap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/mipmap.c') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 0727e1818f..e594160ad9 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1764,8 +1764,13 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target, } else if (srcImage->_BaseFormat == GL_RGBA) { convertFormat = MESA_FORMAT_RGBA8888; components = 4; - } - else { + } else if (srcImage->_BaseFormat == GL_LUMINANCE) { + convertFormat = MESA_FORMAT_L8; + components = 1; + } else if (srcImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + convertFormat = MESA_FORMAT_AL88; + components = 2; + } else { _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps"); return; } -- cgit v1.2.3