From aee93f98f9ea68404a3de0ab8d7bd7e954924318 Mon Sep 17 00:00:00 2001 From: FernandoS27 Date: Mon, 29 Oct 2018 21:34:44 -0400 Subject: Fix ASTC formats --- src/video_core/textures/decoders.cpp | 12 +++++++----- src/video_core/textures/decoders.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/video_core/textures') diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 550ca856c..3066abf61 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -227,12 +227,14 @@ u32 BytesPerPixel(TextureFormat format) { } } -std::vector UnswizzleTexture(VAddr address, u32 tile_size, u32 bytes_per_pixel, u32 width, - u32 height, u32 depth, u32 block_height, u32 block_depth) { +std::vector UnswizzleTexture(VAddr address, u32 tile_size_x, u32 tile_size_y, + u32 bytes_per_pixel, u32 width, u32 height, u32 depth, + u32 block_height, u32 block_depth) { std::vector unswizzled_data(width * height * depth * bytes_per_pixel); - CopySwizzledData(width / tile_size, height / tile_size, depth, bytes_per_pixel, bytes_per_pixel, - Memory::GetPointer(address), unswizzled_data.data(), true, block_height, - block_depth); + CopySwizzledData((width + tile_size_x - 1) / tile_size_x, + (height + tile_size_y - 1) / tile_size_y, depth, bytes_per_pixel, + bytes_per_pixel, Memory::GetPointer(address), unswizzled_data.data(), true, + block_height, block_depth); return unswizzled_data; } diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h index b390219e4..ba065510b 100644 --- a/src/video_core/textures/decoders.h +++ b/src/video_core/textures/decoders.h @@ -19,8 +19,8 @@ inline std::size_t GetGOBSize() { /** * Unswizzles a swizzled texture without changing its format. */ -std::vector UnswizzleTexture(VAddr address, u32 tile_size, u32 bytes_per_pixel, u32 width, - u32 height, u32 depth, +std::vector UnswizzleTexture(VAddr address, u32 tile_size_x, u32 tile_size_y, + u32 bytes_per_pixel, u32 width, u32 height, u32 depth, u32 block_height = TICEntry::DefaultBlockHeight, u32 block_depth = TICEntry::DefaultBlockHeight); -- cgit v1.2.3