[Mesa-dev] [PATCH 1/6] mesa/glformats: expose certain compressed formats to desktop GL

Nanley Chery nanleychery at gmail.com
Mon Sep 14 09:39:00 PDT 2015


On Fri, Aug 28, 2015 at 9:17 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> On Fri, Aug 28, 2015 at 10:50 AM, Nanley Chery <nanleychery at gmail.com>
> wrote:
> > From: Nanley Chery <nanley.g.chery at intel.com>
> >
> > According to the extensions table and our glext headers, these
> > extensions are only supported in the core and compatibility
> > profiles of desktop GL.
> >
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >  src/mesa/main/glformats.c | 4 ++--
> >  src/mesa/main/teximage.c  | 6 ++++--
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> > index ce66699..5f46770 100644
> > --- a/src/mesa/main/glformats.c
> > +++ b/src/mesa/main/glformats.c
> > @@ -1278,10 +1278,10 @@ _mesa_is_compressed_format(const struct
> gl_context *ctx, GLenum format)
> >     case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
> >     case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
> >     case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
> > -      return ctx->API == API_OPENGL_COMPAT
> > +      return _mesa_is_desktop_gl(ctx)
> >           && ctx->Extensions.EXT_texture_compression_latc;
>
> Isn't luminance compat-only? The ext should probably be marked as GLL
> instead. Hopefully someone can confirm...
>
> You're right. Looking at the 3.1 spec, luminance and alpha formats are
deprecated and should be compat-only. I will create another patch to fix
the table and the bug in the _mesa_base_tex_format.

>     case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
> > -      return ctx->API == API_OPENGL_COMPAT
> > +      return _mesa_is_desktop_gl(ctx)
> >           && ctx->Extensions.ATI_texture_compression_3dc;
>
> Same for this.
>
> Agreed.


> >     case GL_ETC1_RGB8_OES:
> >        return _mesa_is_gles(ctx)
> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> > index bfb0858..33b3def 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 (_mesa_is_desktop_gl(ctx) &&
> > +      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 (_mesa_is_desktop_gl(ctx) &&
> > +      ctx->Extensions.ATI_texture_compression_3dc) {
> >        switch (internalFormat) {
> >        case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
> >           return GL_LUMINANCE_ALPHA;
> > --
> > 2.5.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150914/edc2c973/attachment.html>


More information about the mesa-dev mailing list