[Mesa-dev] [PATCH] mesa/glformats: restrict luminance alpha formats to API_OPENGL_COMPAT

Anuj Phogat anuj.phogat at gmail.com
Mon Sep 14 15:33:58 PDT 2015


On Mon, Sep 14, 2015 at 11:17 AM, Nanley Chery <nanleychery at gmail.com>
wrote:

> From: Nanley Chery <nanley.g.chery at intel.com>
>
> According the GL 3.1 spec, luminance alpha formats are deprecated.
>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/mesa/main/extensions.c | 4 ++--
>  src/mesa/main/teximage.c   | 6 ++++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 1f7d542..b2c88c3 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -263,7 +263,7 @@ static const struct extension extension_table[] = {
>     { "GL_EXT_texture_compression_dxt1",
> o(ANGLE_texture_compression_dxt),           GL | ES1 | ES2, 2004 },
>     { "GL_ANGLE_texture_compression_dxt3",
> o(ANGLE_texture_compression_dxt),           GL | ES1 | ES2, 2011 },
>     { "GL_ANGLE_texture_compression_dxt5",
> o(ANGLE_texture_compression_dxt),           GL | ES1 | ES2, 2011 },
> -   { "GL_EXT_texture_compression_latc",
> o(EXT_texture_compression_latc),            GL,             2006 },
> +   { "GL_EXT_texture_compression_latc",
> o(EXT_texture_compression_latc),            GLL,            2006 },
>     { "GL_EXT_texture_compression_rgtc",
> o(ARB_texture_compression_rgtc),            GL,             2004 },
>     { "GL_EXT_texture_compression_s3tc",
> o(EXT_texture_compression_s3tc),            GL,             2000 },
>     { "GL_EXT_texture_cube_map",
> o(ARB_texture_cube_map),                    GLL,            2001 },
> @@ -366,7 +366,7 @@ static const struct extension extension_table[] = {
>     { "GL_ATI_draw_buffers",                        o(dummy_true),
>                       GLL,            2002 },
>     { "GL_ATI_fragment_shader",
>  o(ATI_fragment_shader),                     GLL,            2001 },
>     { "GL_ATI_separate_stencil",
> o(ATI_separate_stencil),                    GLL,            2006 },
> -   { "GL_ATI_texture_compression_3dc",
>  o(ATI_texture_compression_3dc),             GL,             2004 },
> +   { "GL_ATI_texture_compression_3dc",
>  o(ATI_texture_compression_3dc),             GLL,            2004 },
>     { "GL_ATI_texture_env_combine3",
> o(ATI_texture_env_combine3),                GLL,            2002 },
>     { "GL_ATI_texture_float",                       o(ARB_texture_float),
>                      GL,             2002 },
>     { "GL_ATI_texture_mirror_once",
>  o(ATI_texture_mirror_once),                 GL,             2006 },
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index bfb0858..ff844cd 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -534,7 +534,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint
> internalFormat )
>        }
>     }
>
> -   if (ctx->Extensions.EXT_texture_compression_latc) {
> +   if (ctx->API == API_OPENGL_COMPAT &&
> +       ctx->Extensions.EXT_texture_compression_latc) {
>        switch (internalFormat) {
>        case GL_COMPRESSED_LUMINANCE_LATC1_EXT:
>        case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
> @@ -547,7 +548,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint
> internalFormat )
>        }
>     }
>
> -   if (ctx->Extensions.ATI_texture_compression_3dc) {
> +   if (ctx->API == API_OPENGL_COMPAT &&
> +       ctx->Extensions.ATI_texture_compression_3dc) {
>        switch (internalFormat) {
>        case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
>           return GL_LUMINANCE_ALPHA;
> --
> 2.5.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150914/55d28818/attachment-0001.html>


More information about the mesa-dev mailing list