VideoCommon: add function to check whether TextureFormat is a valid value

This commit is contained in:
iwubcode 2022-03-02 00:36:10 -06:00
parent e18053d307
commit a1892a9c68
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,11 @@ static inline bool IsColorIndexed(TextureFormat format)
format == TextureFormat::C14X2; format == TextureFormat::C14X2;
} }
static inline bool IsValidTextureFormat(TextureFormat format)
{
return format <= TextureFormat::RGBA8 || IsColorIndexed(format) || format == TextureFormat::CMPR;
}
// The EFB Copy pipeline looks like: // The EFB Copy pipeline looks like:
// //
// 1. Read EFB -> 2. Select color/depth -> 3. Downscale (optional) // 1. Read EFB -> 2. Select color/depth -> 3. Downscale (optional)