From 1881f41b6c3fe6e68b76c561f33942657b135bc8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 14 Feb 2018 21:19:33 +0100 Subject: mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_gl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is more accurate with respect to the compatibility profile. Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/mesa/main/get.c | 2 +- src/mesa/main/varray.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 13d5e857ab2..7c3b9dd22cb 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2555,7 +2555,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_SAMPLER_BINDING: { struct gl_sampler_object *samp; - if (ctx->API != API_OPENGL_CORE) + if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 33) goto invalid_enum; if (index >= _mesa_max_tex_unit(ctx)) goto invalid_value; diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index bcd78373f50..c6cacf426c0 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -522,7 +522,7 @@ validate_array(struct gl_context *ctx, const char *func, return; } - if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 && + if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 44 && stride > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > " "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride); @@ -2166,7 +2166,7 @@ vertex_array_vertex_buffer_err(struct gl_context *ctx, return; } - if (((ctx->API == API_OPENGL_CORE && ctx->Version >= 44) || _mesa_is_gles31(ctx)) && + if (((_mesa_is_desktop_gl(ctx) && ctx->Version >= 44) || _mesa_is_gles31(ctx)) && stride > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > " "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride); @@ -2320,7 +2320,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx, continue; } - if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 && + if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 44 && strides[i] > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(strides[%u]=%d > " -- cgit v1.2.3