From a1892a9c68895c05493bd203996d8ab812283614 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Wed, 2 Mar 2022 00:36:10 -0600 Subject: [PATCH] VideoCommon: add function to check whether TextureFormat is a valid value --- Source/Core/VideoCommon/TextureDecoder.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h index a00e95d8f2..dcc7513d43 100644 --- a/Source/Core/VideoCommon/TextureDecoder.h +++ b/Source/Core/VideoCommon/TextureDecoder.h @@ -50,6 +50,11 @@ static inline bool IsColorIndexed(TextureFormat format) format == TextureFormat::C14X2; } +static inline bool IsValidTextureFormat(TextureFormat format) +{ + return format <= TextureFormat::RGBA8 || IsColorIndexed(format) || format == TextureFormat::CMPR; +} + // The EFB Copy pipeline looks like: // // 1. Read EFB -> 2. Select color/depth -> 3. Downscale (optional)