summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures/decoders.cpp
diff options
context:
space:
mode:
authorgreggameplayer <33609333+greggameplayer@users.noreply.github.com>2018-11-06 19:05:57 +0100
committerGitHub <noreply@github.com>2018-11-06 19:05:57 +0100
commitd3b9599b2dd084db5b180a6b13ea0ceaec5c7587 (patch)
tree79bcd8922cb90d06b61e07b5cc6e84e320aa3128 /src/video_core/textures/decoders.cpp
parentcorrect syntax (diff)
parentMerge pull request #1649 from degasus/split_resource_manager (diff)
downloadyuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.gz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.bz2
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.lz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.xz
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.tar.zst
yuzu-d3b9599b2dd084db5b180a6b13ea0ceaec5c7587.zip
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
-rw-r--r--src/video_core/textures/decoders.cpp12
1 files changed, 7 insertions, 5 deletions
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<u8> UnswizzleTexture(VAddr address, u32 tile_size, u32 bytes_per_pixel, u32 width,
- u32 height, u32 depth, u32 block_height, u32 block_depth) {
+std::vector<u8> 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<u8> 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;
}