From 52dc8b4f7bd6a8127c2a39edcb5193d1b5e89309 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 16 Nov 2018 11:07:01 +0100 Subject: [PATCH] mesa/main: do not allow floating-point texture enums on gles1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ctx->Extensions.OES_texture_float is set regardless of the API that's used, so checking for those direcly will always allow the enums from this extensions when they are supported by the driver. There's no extension enabling floating-point textures for OpenGL ES 1.x, so we shouldn't allow those enums there. Signed-off-by: Erik Faye-Lund Reviewed-by: Marek Olšák --- src/mesa/main/glformats.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index aca5012beb8..174f17d882d 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -2895,7 +2895,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; break; case GL_RGBA: - if (ctx->Extensions.OES_texture_float && internalFormat == format) + if (_mesa_has_OES_texture_float(ctx) && internalFormat == format) break; default: return GL_INVALID_OPERATION; @@ -2903,7 +2903,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, break; case GL_HALF_FLOAT_OES: - if (ctx->Extensions.OES_texture_half_float && internalFormat == format) + if (_mesa_has_OES_texture_half_float(ctx) && internalFormat == format) break; default: return GL_INVALID_OPERATION; @@ -3030,7 +3030,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; break; case GL_RGB: - if (ctx->Extensions.OES_texture_float && internalFormat == format) + if (_mesa_has_OES_texture_float(ctx) && internalFormat == format) break; default: return GL_INVALID_OPERATION; @@ -3038,7 +3038,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, break; case GL_HALF_FLOAT_OES: - if (!ctx->Extensions.OES_texture_half_float || internalFormat != format) + if (!_mesa_has_OES_texture_half_float(ctx) || internalFormat != format) return GL_INVALID_OPERATION; break; @@ -3138,7 +3138,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, break; case GL_RG: if (_mesa_has_rg_textures(ctx) && - ctx->Extensions.OES_texture_half_float) + _mesa_has_OES_texture_half_float(ctx)) break; /* fallthrough */ default: @@ -3153,7 +3153,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, break; case GL_RG: if (_mesa_has_rg_textures(ctx) && - ctx->Extensions.OES_texture_float) + _mesa_has_OES_texture_float(ctx)) break; /* fallthrough */ default: @@ -3242,7 +3242,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, case GL_RG: case GL_RED: if (_mesa_has_rg_textures(ctx) && - ctx->Extensions.OES_texture_half_float) + _mesa_has_OES_texture_half_float(ctx)) break; /* fallthrough */ default: @@ -3257,7 +3257,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, break; case GL_RED: if (_mesa_has_rg_textures(ctx) && - ctx->Extensions.OES_texture_float) + _mesa_has_OES_texture_float(ctx)) break; /* fallthrough */ default: @@ -3369,11 +3369,11 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx, case GL_LUMINANCE_ALPHA: switch (type) { case GL_FLOAT: - if (!ctx->Extensions.OES_texture_float || internalFormat != format) + if (!_mesa_has_OES_texture_float(ctx) || internalFormat != format) return GL_INVALID_OPERATION; break; case GL_HALF_FLOAT_OES: - if (!ctx->Extensions.OES_texture_half_float || internalFormat != format) + if (!_mesa_has_OES_texture_half_float(ctx) || internalFormat != format) return GL_INVALID_OPERATION; break; case GL_UNSIGNED_BYTE: -- 2.30.2