From 1e4f12d7acbb86081dbd57139ff3de9c193a5c3e Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 11 Dec 2023 16:30:55 +0100 Subject: [PATCH] mesa/main: use _mesa_is_desktop_gl_compat-helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/texparam.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 780de78713e..784092f1829 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -463,7 +463,7 @@ set_tex_parameteri(struct gl_context *ctx, return GL_TRUE; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) + if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES) goto invalid_pname; if (params[0] && texObj->Target == GL_TEXTURE_EXTERNAL_OES) @@ -824,7 +824,7 @@ set_tex_parameterf(struct gl_context *ctx, return GL_TRUE; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; flush(ctx); @@ -1825,7 +1825,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, } break; case GL_TEXTURE_BORDER: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = img->Border; break; @@ -1840,7 +1840,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, break; case GL_TEXTURE_INTENSITY_SIZE: case GL_TEXTURE_LUMINANCE_SIZE: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; if (_mesa_base_format_has_channel(img->_BaseFormat, pname)) { *params = _mesa_get_format_bits(texFormat, pname); @@ -1893,7 +1893,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, /* GL_ARB_texture_float */ case GL_TEXTURE_LUMINANCE_TYPE_ARB: case GL_TEXTURE_INTENSITY_TYPE_ARB: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; FALLTHROUGH; case GL_TEXTURE_RED_TYPE_ARB: @@ -2376,13 +2376,13 @@ get_tex_parameterfv(struct gl_context *ctx, } break; case GL_TEXTURE_RESIDENT: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = 1.0F; break; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = obj->Attrib.Priority; @@ -2414,7 +2414,7 @@ get_tex_parameterfv(struct gl_context *ctx, *params = obj->Sampler.Attrib.MaxAnisotropy; break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) + if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLfloat) obj->Attrib.GenerateMipmap; @@ -2435,7 +2435,7 @@ get_tex_parameterfv(struct gl_context *ctx, /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has * never existed in OpenGL ES. */ - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = (GLfloat) obj->Attrib.DepthMode; break; @@ -2634,13 +2634,13 @@ get_tex_parameteriv(struct gl_context *ctx, } break; case GL_TEXTURE_RESIDENT: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = 1; break; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = FLOAT_TO_INT(obj->Attrib.Priority); @@ -2700,7 +2700,7 @@ get_tex_parameteriv(struct gl_context *ctx, *params = LCLAMPF(obj->Sampler.Attrib.MaxAnisotropy, INT32_MIN, INT32_MAX); break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) + if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLint) obj->Attrib.GenerateMipmap; @@ -2718,7 +2718,7 @@ get_tex_parameteriv(struct gl_context *ctx, *params = (GLint) obj->Sampler.Attrib.CompareFunc; break; case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->API != API_OPENGL_COMPAT) + if (!_mesa_is_desktop_gl_compat(ctx)) goto invalid_pname; *params = (GLint) obj->Attrib.DepthMode; break;