From b6c2d9a911bdff607b322861a1efdbc9422f0433 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 3 Jun 2024 09:53:09 +0200 Subject: [PATCH] mesa/main: remove duplicate error-checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've already verified that both of these enums are valid earlier in this function, so let's remove the duplicate checks here. Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/glformats.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index b51f1c9d166..5c7057190dd 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -1942,8 +1942,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return _mesa_has_texture_shared_exponent(ctx) ? GL_NO_ERROR : GL_INVALID_ENUM; case GL_UNSIGNED_INT_10F_11F_11F_REV: - return _mesa_has_packed_float(ctx) - ? GL_NO_ERROR : GL_INVALID_ENUM; + return GL_NO_ERROR; default: return GL_INVALID_ENUM; } @@ -2019,9 +2018,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return GL_INVALID_OPERATION; case GL_DEPTH_STENCIL: - if (type == GL_UNSIGNED_INT_24_8) - return GL_NO_ERROR; - else if (_mesa_has_float_depth_buffer(ctx) && + if (type == GL_UNSIGNED_INT_24_8 || type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV) return GL_NO_ERROR; else