[Mesa-dev] [RFC 17/21] mesa: Fix ARB_ES3_compatibility functionality leaks
Marek Olšák
maraeo at gmail.com
Tue Oct 20 08:45:18 PDT 2015
NAK. I'd like this extension in compatibility contexts. The fact the
spec requires OpenGL 3.3 was just authors' laziness.
Generally, when a spec requires 3.3, we should allow 3.0 at least,
because Mesa doesn't support 3.3 compatibility contexts.
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.
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
More information about the mesa-dev
mailing list