mesa/glformats: make _mesa_gles_error_check_format_and_type() more consistent
Let's consistently use the following code format instead of relying on
falling through to `default`:
if (!req)
return GL_INVALID_OPERATION;
break;
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5729>
This commit is contained in:
committed by
Marge Bot
parent
a573c8cd47
commit
9e2afe4f05
+25
-25
@@ -2926,18 +2926,18 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
case GL_RGBA:
|
||||
if (_mesa_has_OES_texture_float(ctx) && internalFormat == format)
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_OES_texture_float(ctx) || internalFormat != format)
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_HALF_FLOAT_OES:
|
||||
if (_mesa_has_OES_texture_half_float(ctx) && internalFormat == format)
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_OES_texture_half_float(ctx) || internalFormat != format)
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
@@ -3068,9 +3068,9 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
case GL_RGB:
|
||||
if (_mesa_has_OES_texture_float(ctx) && internalFormat == format)
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_OES_texture_float(ctx) || internalFormat != format)
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
@@ -3180,10 +3180,10 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
case GL_RG:
|
||||
if (_mesa_has_rg_textures(ctx) &&
|
||||
_mesa_has_OES_texture_half_float(ctx))
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_rg_textures(ctx) ||
|
||||
!_mesa_has_OES_texture_half_float(ctx))
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
@@ -3195,10 +3195,10 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
case GL_RG32F:
|
||||
break;
|
||||
case GL_RG:
|
||||
if (_mesa_has_rg_textures(ctx) &&
|
||||
_mesa_has_OES_texture_float(ctx))
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_rg_textures(ctx) ||
|
||||
!_mesa_has_OES_texture_float(ctx))
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
@@ -3288,10 +3288,10 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
break;
|
||||
case GL_RG:
|
||||
case GL_RED:
|
||||
if (_mesa_has_rg_textures(ctx) &&
|
||||
_mesa_has_OES_texture_half_float(ctx))
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_rg_textures(ctx) ||
|
||||
!_mesa_has_OES_texture_half_float(ctx))
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
@@ -3303,10 +3303,10 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
|
||||
case GL_R32F:
|
||||
break;
|
||||
case GL_RED:
|
||||
if (_mesa_has_rg_textures(ctx) &&
|
||||
_mesa_has_OES_texture_float(ctx))
|
||||
break;
|
||||
/* fallthrough */
|
||||
if (!_mesa_has_rg_textures(ctx) ||
|
||||
!_mesa_has_OES_texture_float(ctx))
|
||||
return GL_INVALID_OPERATION;
|
||||
break;
|
||||
default:
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user