diff options
author | Anuj Phogat <[email protected]> | 2012-11-05 17:45:18 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-12-07 16:29:47 -0800 |
commit | e519b8a9af0f994d6b33e748ada463ff19df7ab8 (patch) | |
tree | 93b8fcc4d178b33bf82e69fb1c4e3febb15d22ae /src/mesa/main/glformats.c | |
parent | 23b7103ceec5d16efaa3a04813a093217c717688 (diff) |
mesa: Add new MESA_FORMATs for ETC2 compressed textures
It is required by OpenGL ES 3.0 to support ETC2 textures.
This patch adds new MESA_FORMATs for following etc2 texture
formats:
GL_COMPRESSED_RGB8_ETC2
GL_COMPRESSED_SRGB8_ETC2
GL_COMPRESSED_RGBA8_ETC2_EAC
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
GL_COMPRESSED_R11_EAC
GL_COMPRESSED_RG11_EAC
GL_COMPRESSED_SIGNED_R11_EAC
GL_COMPRESSED_SIGNED_RG11_EAC
MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1
MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1
Above formats are currently available in only gles 3.0.
v2: Add entries in texfetch_funcs[] array.
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
v3 (Paul Berry <[email protected]>): comment out symbols that
are not implemented yet, so that this commit compiles on its own;
future commits will uncomment the symbols as they become available.
Diffstat (limited to 'src/mesa/main/glformats.c')
-rw-r--r-- | src/mesa/main/glformats.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 69caef70b74..fefa9c44105 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -570,6 +570,16 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: case GL_ETC1_RGB8_OES: + case GL_COMPRESSED_RGB8_ETC2: + case GL_COMPRESSED_SRGB8_ETC2: + case GL_COMPRESSED_RGBA8_ETC2_EAC: + case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + case GL_COMPRESSED_R11_EAC: + case GL_COMPRESSED_RG11_EAC: + case GL_COMPRESSED_SIGNED_R11_EAC: + case GL_COMPRESSED_SIGNED_RG11_EAC: + case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: /* generic integer formats */ case GL_RED_INTEGER_EXT: case GL_GREEN_INTEGER_EXT: @@ -829,6 +839,17 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) case GL_ETC1_RGB8_OES: return _mesa_is_gles(ctx) && ctx->Extensions.OES_compressed_ETC1_RGB8_texture; + case GL_COMPRESSED_RGB8_ETC2: + case GL_COMPRESSED_SRGB8_ETC2: + case GL_COMPRESSED_RGBA8_ETC2_EAC: + case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: + case GL_COMPRESSED_R11_EAC: + case GL_COMPRESSED_RG11_EAC: + case GL_COMPRESSED_SIGNED_R11_EAC: + case GL_COMPRESSED_SIGNED_RG11_EAC: + case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: + case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: + return _mesa_is_gles3(ctx); case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: case GL_PALETTE4_R5_G6_B5_OES: |