summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures/decoders.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-16 02:53:15 +0200
committerSubv <subv2112@gmail.com>2018-04-18 19:52:51 +0200
commit6b63aaa5b4f55621117e27c6b80979908c255e75 (patch)
tree14ea1f2ecd3c195867f22a4ae6e68626d13e2dd7 /src/video_core/textures/decoders.cpp
parentGPU/TIC: Added the pitch and block height fields to the TIC structure. (diff)
downloadyuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar.gz
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar.bz2
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar.lz
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar.xz
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.tar.zst
yuzu-6b63aaa5b4f55621117e27c6b80979908c255e75.zip
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) {
}
}
-std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height) {
+std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height,
+ u32 block_height) {
u8* data = Memory::GetPointer(address);
u32 bytes_per_pixel = BytesPerPixel(format);
- static constexpr u32 DefaultBlockHeight = 16;
-
std::vector<u8> unswizzled_data(width * height * bytes_per_pixel);
switch (format) {
case TextureFormat::DXT1:
// In the DXT1 format, 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, DefaultBlockHeight);
+ unswizzled_data.data(), true, block_height);
break;
case TextureFormat::A8R8G8B8:
CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
- unswizzled_data.data(), true, DefaultBlockHeight);
+ unswizzled_data.data(), true, block_height);
break;
default:
UNIMPLEMENTED_MSG("Format not implemented");