summaryrefslogtreecommitdiff
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-03-07 02:03:52 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-08 23:52:37 +0100
commit7d16e2c0cd70dc5a23b746dbc8e44c58366b5353 (patch)
treedd8767ec968eebe4f8a75c0d53c4537e69a2d088 /src/mesa/main/image.c
parent12fa91b6753dccbd3aa12c570d1f1e55c7dc0582 (diff)
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.
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 63936132f9..18abf2882a 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -743,6 +743,10 @@ _mesa_is_color_format(GLenum format)
case GL_COMPRESSED_SIGNED_RED_RGTC1:
case GL_COMPRESSED_RG_RGTC2:
case GL_COMPRESSED_SIGNED_RG_RGTC2:
+ case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
+ case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
/* signed, normalized texture formats */
case GL_RGBA_SNORM:
case GL_RGBA8_SNORM:
@@ -1025,6 +1029,11 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
case GL_COMPRESSED_RG_RGTC2:
case GL_COMPRESSED_SIGNED_RG_RGTC2:
return ctx->Extensions.ARB_texture_compression_rgtc;
+ case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
+ case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
+ case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
+ return ctx->Extensions.EXT_texture_compression_latc;
default:
return GL_FALSE;
}