[Mesa-dev] [RFC 16/21] mesa: Fix ARB_texture_compression_bptc functionality leaks

Nanley Chery nanleychery at gmail.com
Tue Oct 20 14:14:35 PDT 2015


On Tue, Oct 20, 2015 at 8:37 AM, Marek Olšák <maraeo at gmail.com> wrote:

> NAK. I'd like this extension in compatibility contexts. The fact the
> spec requires OpenGL 3.1 was just authors' laziness.
>
>
I had thought it might be the case that some specs may unecessarily require
a certain version,
when in fact a longer list of dependencies would suffice instead. I'll look
into this issue. If it's
the right way to go, I can allow all versions of GL compatibility by simply
replacing the '31'
with 'GLL' in a v2.



> Marek
>
> On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery <nanleychery at gmail.com>
> wrote:
> > From: Nanley Chery <nanley.g.chery at intel.com>
> >
> > Stop leaks into the following contexts:
> >    * GLES in _mesa_target_can_be_compressed().
> >    * Pre-3.1 GL legacy versions in all uses.
> >
> > The extension spec lists OpenGL 3.1 as required, so update the extension
> > table accordingly.
> >
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >  src/mesa/main/extensions_table.h | 2 +-
> >  src/mesa/main/glformats.c        | 3 +--
> >  src/mesa/main/teximage.c         | 2 +-
> >  3 files changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/mesa/main/extensions_table.h
> b/src/mesa/main/extensions_table.h
> > index cf6eed7..62e0804 100644
> > --- a/src/mesa/main/extensions_table.h
> > +++ b/src/mesa/main/extensions_table.h
> > @@ -93,7 +93,7 @@ EXT(ARB_texture_buffer_object               ,
> ARB_texture_buffer_object
> >  EXT(ARB_texture_buffer_object_rgb32         ,
> ARB_texture_buffer_object_rgb32        ,  x , GLC,  x ,  x , 2009)
> >  EXT(ARB_texture_buffer_range                , ARB_texture_buffer_range
>              ,  x , GLC,  x ,  x , 2012)
> >  EXT(ARB_texture_compression                 , dummy_true
>              , GLL,  x ,  x ,  x , 2000)
> > -EXT(ARB_texture_compression_bptc            ,
> ARB_texture_compression_bptc           , GLL, GLC,  x ,  x , 2010)
> > +EXT(ARB_texture_compression_bptc            ,
> ARB_texture_compression_bptc           ,  31, GLC,  x ,  x , 2010)
> >  EXT(ARB_texture_compression_rgtc            ,
> ARB_texture_compression_rgtc           , GLL, GLC,  x ,  x , 2004)
> >  EXT(ARB_texture_cube_map                    , ARB_texture_cube_map
>              , GLL,  x ,  x ,  x , 1999)
> >  EXT(ARB_texture_cube_map_array              ,
> ARB_texture_cube_map_array             , GLL, GLC,  x ,  x , 2009)
> > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> > index 9134d7d..542dcfc 100644
> > --- a/src/mesa/main/glformats.c
> > +++ b/src/mesa/main/glformats.c
> > @@ -1327,8 +1327,7 @@ _mesa_is_compressed_format(const struct gl_context
> *ctx, GLenum format)
> >     case MESA_FORMAT_LAYOUT_ETC2:
> >        return _mesa_is_gles3(ctx) ||
> ctx->Extensions.ARB_ES3_compatibility;
> >     case MESA_FORMAT_LAYOUT_BPTC:
> > -      return _mesa_is_desktop_gl(ctx) &&
> > -         ctx->Extensions.ARB_texture_compression_bptc;
> > +      return _mesa_has_ARB_texture_compression_bptc(ctx);
> >     case MESA_FORMAT_LAYOUT_ASTC:
> >        return _mesa_has_KHR_texture_compression_astc_ldr(ctx);
> >     default:
> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> > index c14f941..7910fe7 100644
> > --- a/src/mesa/main/teximage.c
> > +++ b/src/mesa/main/teximage.c
> > @@ -1387,7 +1387,7 @@ _mesa_target_can_be_compressed(const struct
> gl_context *ctx, GLenum target,
> >              return write_error(error, GL_INVALID_OPERATION);
> >           break;
> >        case MESA_FORMAT_LAYOUT_BPTC:
> > -         target_can_be_compresed =
> ctx->Extensions.ARB_texture_compression_bptc;
> > +         target_can_be_compresed =
> _mesa_has_ARB_texture_compression_bptc(ctx);
> >           break;
> >        case MESA_FORMAT_LAYOUT_ASTC:
> >           target_can_be_compresed =
> > --
> > 2.6.1
> >
> > _______________________________________________
> > 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/20151020/84fcfff5/attachment.html>


More information about the mesa-dev mailing list