[Mesa-dev] [RFC 17/21] mesa: Fix ARB_ES3_compatibility functionality leaks

Nanley Chery nanleychery at gmail.com
Tue Oct 20 16:32:25 PDT 2015


On Tue, Oct 20, 2015 at 8:45 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.3 was just authors' laziness.
>
>
If it's the right thing to do, I can allow all versions of GL compatibility
by
simply replacing '33' with 'GLL' in a v2. I'll try to nail down what the
actual minimum version required is.


> Generally, when a spec requires 3.3, we should allow 3.0 at least,
> because Mesa doesn't support 3.3 compatibility contexts.
>
>

I will keep this in mind.


> Unless you have a very good _technical_ reason not to support this
> extension, it should be supported by all versions. This applies to
> other such patches as well.
>
>
GL  3.3 may have introduced a new feature on which this extension is
dependent.
If this feature is not contained within any other extension and our context
version
is less than 3.3, we may not be able to actually implement the extension
spec as
described. I will try to see if this is the case. I agree that technical
roadblocks should be the
only things which prevent us from advertising certain extensions.

Thanks,
Nanley

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 GLES1/2 and pre-3.3 GL contexts in all uses.
> >
> > The extension spec lists OpenGL 3.3 as one of the requirements, so
> > update the extension table accordingly.
> >
> > v2. Require 3.3 for GL legacy contexts as well (Chad).
> >
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >  src/mesa/main/enable.c           | 4 ++--
> >  src/mesa/main/extensions_table.h | 2 +-
> >  src/mesa/main/glformats.c        | 2 +-
> >  src/mesa/main/queryobj.c         | 2 +-
> >  4 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> > index 42f6799..ee95334 100644
> > --- a/src/mesa/main/enable.c
> > +++ b/src/mesa/main/enable.c
> > @@ -972,7 +972,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap,
> GLboolean state)
> >           break;
> >
> >        case GL_PRIMITIVE_RESTART_FIXED_INDEX:
> > -        if (!_mesa_is_gles3(ctx) &&
> !ctx->Extensions.ARB_ES3_compatibility)
> > +        if (!_mesa_is_gles3(ctx) &&
> !_mesa_has_ARB_ES3_compatibility(ctx))
> >              goto invalid_enum_error;
> >           if (ctx->Array.PrimitiveRestartFixedIndex != state) {
> >              FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
> > @@ -1582,7 +1582,7 @@ _mesa_IsEnabled( GLenum cap )
> >           return ctx->Array.PrimitiveRestart;
> >
> >        case GL_PRIMITIVE_RESTART_FIXED_INDEX:
> > -        if (!_mesa_is_gles3(ctx) &&
> !ctx->Extensions.ARB_ES3_compatibility) {
> > +        if (!_mesa_is_gles3(ctx) &&
> !_mesa_has_ARB_ES3_compatibility(ctx)) {
> >              goto invalid_enum_error;
> >           }
> >           return ctx->Array.PrimitiveRestartFixedIndex;
> > diff --git a/src/mesa/main/extensions_table.h
> b/src/mesa/main/extensions_table.h
> > index 62e0804..760fbe9 100644
> > --- a/src/mesa/main/extensions_table.h
> > +++ b/src/mesa/main/extensions_table.h
> > @@ -4,7 +4,7 @@
> >  #define ES2 1u
> >  #define  x ~0u
> >  EXT(ARB_ES2_compatibility                   , ARB_ES2_compatibility
>               , GLL, GLC,  x ,  x , 2009)
> > -EXT(ARB_ES3_compatibility                   , ARB_ES3_compatibility
>               , GLL, GLC,  x ,  x , 2012)
> > +EXT(ARB_ES3_compatibility                   , ARB_ES3_compatibility
>               ,  33,  33,  x ,  x , 2012)
> >  EXT(ARB_arrays_of_arrays                    , ARB_arrays_of_arrays
>              , GLL, GLC,  x ,  x , 2012)
> >  EXT(ARB_base_instance                       , ARB_base_instance
>               , GLL, GLC,  x ,  x , 2011)
> >  EXT(ARB_blend_func_extended                 , ARB_blend_func_extended
>               , GLL, GLC,  x ,  x , 2009)
> > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> > index 542dcfc..6b602d8 100644
> > --- a/src/mesa/main/glformats.c
> > +++ b/src/mesa/main/glformats.c
> > @@ -1325,7 +1325,7 @@ _mesa_is_compressed_format(const struct gl_context
> *ctx, GLenum format)
> >        return _mesa_is_gles(ctx)
> >           && ctx->Extensions.OES_compressed_ETC1_RGB8_texture;
> >     case MESA_FORMAT_LAYOUT_ETC2:
> > -      return _mesa_is_gles3(ctx) ||
> ctx->Extensions.ARB_ES3_compatibility;
> > +      return _mesa_is_gles3(ctx) ||
> _mesa_has_ARB_ES3_compatibility(ctx);
> >     case MESA_FORMAT_LAYOUT_BPTC:
> >        return _mesa_has_ARB_texture_compression_bptc(ctx);
> >     case MESA_FORMAT_LAYOUT_ASTC:
> > diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> > index 9836685..48fd571 100644
> > --- a/src/mesa/main/queryobj.c
> > +++ b/src/mesa/main/queryobj.c
> > @@ -176,7 +176,7 @@ get_query_binding_point(struct gl_context *ctx,
> GLenum target, GLuint index)
> >        else
> >           return NULL;
> >     case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
> > -      if (ctx->Extensions.ARB_ES3_compatibility
> > +      if (_mesa_has_ARB_ES3_compatibility(ctx)
> >            || (ctx->API == API_OPENGLES2 && ctx->Version >= 30))
> >           return &ctx->Query.CurrentOcclusionObject;
> >        else
> > --
> > 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/97047f60/attachment-0001.html>


More information about the mesa-dev mailing list