mirror of
https://github.com/yuzu-emu/yuzu-mainline
synced 2024-11-23 01:33:51 +00:00
video_core/surface: Eliminate casts in GetFormatType()
We can just compare directly and get rid of verbose casting.
This commit is contained in:
parent
6291eec700
commit
a9efea8ae9
1 changed files with 4 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue