summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-11-16 11:07:01 +0100
committerErik Faye-Lund <[email protected]>2018-12-03 18:16:44 +0100
commit52dc8b4f7bd6a8127c2a39edcb5193d1b5e89309 (patch)
tree837f5032798f293916662e8567e64833014aeefc /src
parent167dcd59ae8cc5d4487305f0d220e68f3d0eb01d (diff)
mesa/main: do not allow floating-point texture enums on gles1
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/glformats.c20
1 files 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: