summaryrefslogtreecommitdiff
path: root/src/video_core/textures/decoders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
-rw-r--r--src/video_core/textures/decoders.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 2e87281eb..9c2a10d2e 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -56,23 +56,22 @@ u32 BytesPerPixel(TextureFormat format) {
56 } 56 }
57} 57}
58 58
59std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height) { 59std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height,
60 u32 block_height) {
60 u8* data = Memory::GetPointer(address); 61 u8* data = Memory::GetPointer(address);
61 u32 bytes_per_pixel = BytesPerPixel(format); 62 u32 bytes_per_pixel = BytesPerPixel(format);
62 63
63 static constexpr u32 DefaultBlockHeight = 16;
64
65 std::vector<u8> unswizzled_data(width * height * bytes_per_pixel); 64 std::vector<u8> unswizzled_data(width * height * bytes_per_pixel);
66 65
67 switch (format) { 66 switch (format) {
68 case TextureFormat::DXT1: 67 case TextureFormat::DXT1:
69 // In the DXT1 format, each 4x4 tile is swizzled instead of just individual pixel values. 68 // In the DXT1 format, each 4x4 tile is swizzled instead of just individual pixel values.
70 CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, 69 CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data,
71 unswizzled_data.data(), true, DefaultBlockHeight); 70 unswizzled_data.data(), true, block_height);
72 break; 71 break;
73 case TextureFormat::A8R8G8B8: 72 case TextureFormat::A8R8G8B8:
74 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, 73 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
75 unswizzled_data.data(), true, DefaultBlockHeight); 74 unswizzled_data.data(), true, block_height);
76 break; 75 break;
77 default: 76 default:
78 UNIMPLEMENTED_MSG("Format not implemented"); 77 UNIMPLEMENTED_MSG("Format not implemented");