yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #9347 from lioncash/vcast

video_core/surface: Eliminate casts in GetFormatType()
This commit is contained in:
liamwhite 2022-11-29 08:26:39 -05:00 committed by GitHub
commit 55b546a110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 11 deletions

View File

@ -214,23 +214,16 @@ PixelFormat PixelFormatFromGPUPixelFormat(Service::android::PixelFormat format)
}
SurfaceType GetFormatType(PixelFormat pixel_format) {
if (static_cast<std::size_t>(pixel_format) <
static_cast<std::size_t>(PixelFormat::MaxColorFormat)) {
if (pixel_format < PixelFormat::MaxColorFormat) {
return SurfaceType::ColorTexture;
}
if (static_cast<std::size_t>(pixel_format) <
static_cast<std::size_t>(PixelFormat::MaxDepthFormat)) {
if (pixel_format < PixelFormat::MaxDepthFormat) {
return SurfaceType::Depth;
}
if (static_cast<std::size_t>(pixel_format) <
static_cast<std::size_t>(PixelFormat::MaxStencilFormat)) {
if (pixel_format < PixelFormat::MaxStencilFormat) {
return SurfaceType::Stencil;
}
if (static_cast<std::size_t>(pixel_format) <
static_cast<std::size_t>(PixelFormat::MaxDepthStencilFormat)) {
if (pixel_format < PixelFormat::MaxDepthStencilFormat) {
return SurfaceType::DepthStencil;
}