Mesa (master): mesa/teximage: return the base internal format of the ASTC formats
Nanley Chery
nchery at kemper.freedesktop.org
Wed Aug 26 22:04:12 UTC 2015
Module: Mesa
Branch: master
Commit: cd49b97a8a2c0dd8dc1d7f32b86f519e936571fd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd49b97a8a2c0dd8dc1d7f32b86f519e936571fd
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Tue Apr 28 15:10:11 2015 -0700
mesa/teximage: return the base internal format of the ASTC formats
This is necesary to initialize the gl_texture_image struct.
>From the KHR_texture_compression_astc_ldr spec:
"Added to Section 3.8.6, Compressed Texture Images
Add the tokens specified above to Table 3.16, Compressed Internal Formats.
In all cases, the base internal format will be RGBA. The encoding allows
images to be encoded with fewer channels, but this is always presented as
RGBA to the sampler."
v2. use _mesa_is_astc_format().
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
src/mesa/main/teximage.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 56ae415..0535db3 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -565,6 +565,10 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
}
}
+ if (ctx->Extensions.KHR_texture_compression_astc_ldr &&
+ _mesa_is_astc_format(internalFormat))
+ return GL_RGBA;
+
if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) {
switch (internalFormat) {
case GL_COMPRESSED_RGB8_ETC2:
More information about the mesa-commit
mailing list