From 057170928ce71fb262d4d9969b7889971dc7232a Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 18 Apr 2018 20:48:53 -0500 Subject: GPU: Add support for the DXT23 and DXT45 compressed texture formats. --- src/video_core/textures/decoders.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/video_core/textures/decoders.cpp') diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index f4c7e40df..4df687786 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -48,6 +48,10 @@ u32 BytesPerPixel(TextureFormat format) { case TextureFormat::DXT1: // In this case a 'pixel' actually refers to a 4x4 tile. return 8; + case TextureFormat::DXT23: + case TextureFormat::DXT45: + // In this case a 'pixel' actually refers to a 4x4 tile. + return 16; case TextureFormat::A8R8G8B8: return 4; case TextureFormat::B5G6R5: @@ -67,7 +71,9 @@ std::vector UnswizzleTexture(VAddr address, TextureFormat format, u32 width, switch (format) { case TextureFormat::DXT1: - // In the DXT1 format, each 4x4 tile is swizzled instead of just individual pixel values. + case TextureFormat::DXT23: + case TextureFormat::DXT45: + // In the DXT formats, each 4x4 tile is swizzled instead of just individual pixel values. CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, unswizzled_data.data(), true, block_height); break; @@ -91,6 +97,8 @@ std::vector DecodeTexture(const std::vector& texture_data, TextureFormat // TODO(Subv): Implement. switch (format) { case TextureFormat::DXT1: + case TextureFormat::DXT23: + case TextureFormat::DXT45: case TextureFormat::A8R8G8B8: case TextureFormat::B5G6R5: // TODO(Subv): For the time being just forward the same data without any decoding. -- cgit v1.2.3