From b9ddb517b191b449b8d935acb29962e43054dde4 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Wed, 2 Oct 2019 19:00:16 -0400 Subject: Surfaces: Implement ASTC 6x6 10x10 12x12 8x6 6x5 --- src/video_core/surface.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 250afc6d6..a61dcbfb0 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -350,6 +350,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: @@ -510,6 +520,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; @@ -530,6 +550,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; -- cgit v1.2.3 From f32a49d3d8b820a20c5311a0c27df5846d55b0e9 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Tue, 8 Oct 2019 12:54:59 -0400 Subject: Surfaces: Implement R4G4B4A4U format. --- src/video_core/surface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/video_core/surface.cpp') diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index a61dcbfb0..4416fb4ac 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: -- cgit v1.2.3