summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorFrederic L <frederic.laing.development@gmail.com>2018-11-19 04:53:03 +0100
committerbunnei <bunneidev@gmail.com>2018-11-19 04:53:03 +0100
commit11a1442229e097ddeb092afd4f0bf444c5042b10 (patch)
treef65d63b6f02fa637279f320aba69b2eaee087b89 /src/video_core/textures
parentMerge pull request #1640 from DarkLordZach/game-list-reload (diff)
downloadyuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar.gz
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar.bz2
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar.lz
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar.xz
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.tar.zst
yuzu-11a1442229e097ddeb092afd4f0bf444c5042b10.zip
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/decoders.cpp15
-rw-r--r--src/video_core/textures/decoders.h7
2 files changed, 18 insertions, 4 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 19f30b1b5..c9160b467 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -229,14 +229,21 @@ u32 BytesPerPixel(TextureFormat format) {
}
}
+void UnswizzleTexture(u8* const unswizzled_data, 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) {
+ 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, true,
+ block_height, 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_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);
+ UnswizzleTexture(unswizzled_data.data(), address, tile_size_x, tile_size_y, bytes_per_pixel,
+ width, height, depth, block_height, block_depth);
return unswizzled_data;
}
diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h
index ba065510b..f4ef7c73e 100644
--- a/src/video_core/textures/decoders.h
+++ b/src/video_core/textures/decoders.h
@@ -19,6 +19,13 @@ inline std::size_t GetGOBSize() {
/**
* Unswizzles a swizzled texture without changing its format.
*/
+void UnswizzleTexture(u8* unswizzled_data, 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);
+/**
+ * Unswizzles a swizzled texture without changing its format.
+ */
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 = TICEntry::DefaultBlockHeight,