diff options
| author | bunnei <bunneidev@gmail.com> | 2018-04-18 14:46:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-18 14:46:10 -0400 |
| commit | d3f9ea90e78dce585f23c71c969990439937b427 (patch) | |
| tree | 618163c00bf621be9b7a44535493ceeaabd6257f /src/video_core/textures/decoders.cpp | |
| parent | c93ea96366da6907d8c5d0a4f94c9c4ed7dd39ca (diff) | |
| parent | 48d4efbd696d1dbd5330d74e69a52f8e508d279d (diff) | |
Merge pull request #349 from Subv/texturing
GPU: Support non-tiled textures and configurable block height.
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 9 |
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"); |
