From a9efea8ae984fee95cf10002093dcca86c1d3dab Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 28 Nov 2022 20:25:41 -0500 Subject: video_core/surface: Eliminate casts in GetFormatType() We can just compare directly and get rid of verbose casting. --- src/video_core/surface.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index b618e1a25..1a76d4178 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -214,23 +214,16 @@ PixelFormat PixelFormatFromGPUPixelFormat(Service::android::PixelFormat format) } SurfaceType GetFormatType(PixelFormat pixel_format) { - if (static_cast(pixel_format) < - static_cast(PixelFormat::MaxColorFormat)) { + if (pixel_format < PixelFormat::MaxColorFormat) { return SurfaceType::ColorTexture; } - - if (static_cast(pixel_format) < - static_cast(PixelFormat::MaxDepthFormat)) { + if (pixel_format < PixelFormat::MaxDepthFormat) { return SurfaceType::Depth; } - - if (static_cast(pixel_format) < - static_cast(PixelFormat::MaxStencilFormat)) { + if (pixel_format < PixelFormat::MaxStencilFormat) { return SurfaceType::Stencil; } - - if (static_cast(pixel_format) < - static_cast(PixelFormat::MaxDepthStencilFormat)) { + if (pixel_format < PixelFormat::MaxDepthStencilFormat) { return SurfaceType::DepthStencil; } -- cgit v1.2.3