aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-11-15 17:19:44 +0100
committerErik Faye-Lund <[email protected]>2018-12-03 18:16:44 +0100
commit59690bf0a31300febafd84868781990db0fa215a (patch)
treea74358dd349631750f91de905ed0c288550fa0a5 /src/mesa/main
parent83db9d3e3a6db6ea21a8c09637a133baf9b4ecac (diff)
mesa/main: do not allow EXT_packed_float enums before gles3
EXT_packed_float isn't supported on OpenGL ES, we shouldn't allow these enums there, before OpenGL ES 3.0 which also introduce support for these enums. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.h6
-rw-r--r--src/mesa/main/glformats.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 14f9a6b8987..84dbcb748c9 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -355,6 +355,12 @@ _mesa_has_float_depth_buffer(const struct gl_context *ctx)
return _mesa_has_ARB_depth_buffer_float(ctx) || _mesa_is_gles3(ctx);
}
+static inline bool
+_mesa_has_packed_float(const struct gl_context *ctx)
+{
+ return _mesa_has_EXT_packed_float(ctx) || _mesa_is_gles3(ctx);
+}
+
/**
* Checks if the context supports geometry shaders.
*/
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index a4b17a85b09..0f021e77220 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1858,7 +1858,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
return GL_NO_ERROR;
case GL_UNSIGNED_INT_10F_11F_11F_REV:
- if (!ctx->Extensions.EXT_packed_float) {
+ if (!_mesa_has_packed_float(ctx)) {
return GL_INVALID_ENUM;
}
if (format != GL_RGB) {
@@ -1969,7 +1969,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
return ctx->Extensions.EXT_texture_shared_exponent
? GL_NO_ERROR : GL_INVALID_ENUM;
case GL_UNSIGNED_INT_10F_11F_11F_REV:
- return ctx->Extensions.EXT_packed_float
+ return _mesa_has_packed_float(ctx)
? GL_NO_ERROR : GL_INVALID_ENUM;
default:
return GL_INVALID_ENUM;
@@ -2598,7 +2598,7 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat)
}
}
- if (ctx->Extensions.EXT_packed_float) {
+ if (_mesa_has_packed_float(ctx)) {
switch (internalFormat) {
case GL_R11F_G11F_B10F_EXT:
return GL_RGB;