diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-10-18 00:24:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-18 00:24:11 +0200 |
commit | 219fdcb9d967af3bef6aafa1dc351b824725bbe0 (patch) | |
tree | 231e7949840d075a0aeb156b7bdcb119037b8ad2 /src/video_core/surface.cpp | |
parent | Merge pull request #2979 from lioncash/macro (diff) | |
parent | Surfaces: Implement R4G4B4A4U format. (diff) | |
download | yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar.gz yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar.bz2 yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar.lz yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar.xz yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.tar.zst yuzu-219fdcb9d967af3bef6aafa1dc351b824725bbe0.zip |
Diffstat (limited to 'src/video_core/surface.cpp')
-rw-r--r-- | src/video_core/surface.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index ef6b3592e..9a3c05288 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -212,6 +212,14 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, break; } break; + case Tegra::Texture::TextureFormat::A4B4G4R4: + switch (component_type) { + case Tegra::Texture::ComponentType::UNORM: + return PixelFormat::R4G4B4A4U; + default: + break; + } + break; case Tegra::Texture::TextureFormat::R8: switch (component_type) { case Tegra::Texture::ComponentType::UNORM: @@ -351,6 +359,16 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format, return is_srgb ? PixelFormat::ASTC_2D_8X5_SRGB : PixelFormat::ASTC_2D_8X5; case Tegra::Texture::TextureFormat::ASTC_2D_10X8: return is_srgb ? PixelFormat::ASTC_2D_10X8_SRGB : PixelFormat::ASTC_2D_10X8; + case Tegra::Texture::TextureFormat::ASTC_2D_6X6: + return is_srgb ? PixelFormat::ASTC_2D_6X6_SRGB : PixelFormat::ASTC_2D_6X6; + case Tegra::Texture::TextureFormat::ASTC_2D_10X10: + return is_srgb ? PixelFormat::ASTC_2D_10X10_SRGB : PixelFormat::ASTC_2D_10X10; + case Tegra::Texture::TextureFormat::ASTC_2D_12X12: + return is_srgb ? PixelFormat::ASTC_2D_12X12_SRGB : PixelFormat::ASTC_2D_12X12; + case Tegra::Texture::TextureFormat::ASTC_2D_8X6: + return is_srgb ? PixelFormat::ASTC_2D_8X6_SRGB : PixelFormat::ASTC_2D_8X6; + case Tegra::Texture::TextureFormat::ASTC_2D_6X5: + return is_srgb ? PixelFormat::ASTC_2D_6X5_SRGB : PixelFormat::ASTC_2D_6X5; case Tegra::Texture::TextureFormat::R16_G16: switch (component_type) { case Tegra::Texture::ComponentType::FLOAT: @@ -511,6 +529,16 @@ bool IsPixelFormatASTC(PixelFormat format) { case PixelFormat::ASTC_2D_8X5_SRGB: case PixelFormat::ASTC_2D_10X8: case PixelFormat::ASTC_2D_10X8_SRGB: + case PixelFormat::ASTC_2D_6X6: + case PixelFormat::ASTC_2D_6X6_SRGB: + case PixelFormat::ASTC_2D_10X10: + case PixelFormat::ASTC_2D_10X10_SRGB: + case PixelFormat::ASTC_2D_12X12: + case PixelFormat::ASTC_2D_12X12_SRGB: + case PixelFormat::ASTC_2D_8X6: + case PixelFormat::ASTC_2D_8X6_SRGB: + case PixelFormat::ASTC_2D_6X5: + case PixelFormat::ASTC_2D_6X5_SRGB: return true; default: return false; @@ -531,6 +559,11 @@ bool IsPixelFormatSRGB(PixelFormat format) { case PixelFormat::ASTC_2D_5X4_SRGB: case PixelFormat::ASTC_2D_5X5_SRGB: case PixelFormat::ASTC_2D_10X8_SRGB: + case PixelFormat::ASTC_2D_6X6_SRGB: + case PixelFormat::ASTC_2D_10X10_SRGB: + case PixelFormat::ASTC_2D_12X12_SRGB: + case PixelFormat::ASTC_2D_8X6_SRGB: + case PixelFormat::ASTC_2D_6X5_SRGB: return true; default: return false; |