diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2018-10-30 02:34:44 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2018-11-01 18:08:19 +0100 |
commit | aee93f98f9ea68404a3de0ab8d7bd7e954924318 (patch) | |
tree | f480fc1693cb8092e43cdc5f0e1013bbd6908c9d /src/video_core/renderer_opengl | |
parent | Implemented ASTC 5x5 (diff) | |
download | yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar.gz yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar.bz2 yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar.lz yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar.xz yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.tar.zst yuzu-aee93f98f9ea68404a3de0ab8d7bd7e954924318.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 43c47cb10..19b1d04b9 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -366,15 +366,18 @@ void MortonCopy(u32 stride, u32 block_height, u32 height, u32 block_depth, u32 d // With the BCn formats (DXT and DXN), each 4x4 tile is swizzled instead of just individual // pixel values. - const u32 tile_size{IsFormatBCn(format) ? 4U : 1U}; + const u32 tile_size_x{SurfaceParams::GetDefaultBlockWidth(format)}; + const u32 tile_size_y{SurfaceParams::GetDefaultBlockHeight(format)}; if (morton_to_gl) { - const std::vector<u8> data = Tegra::Texture::UnswizzleTexture( - addr, tile_size, bytes_per_pixel, stride, height, depth, block_height, block_depth); + const std::vector<u8> data = + Tegra::Texture::UnswizzleTexture(addr, tile_size_x, tile_size_y, bytes_per_pixel, + stride, height, depth, block_height, block_depth); const std::size_t size_to_copy{std::min(gl_buffer_size, data.size())}; memcpy(gl_buffer, data.data(), size_to_copy); } else { - Tegra::Texture::CopySwizzledData(stride / tile_size, height / tile_size, depth, + Tegra::Texture::CopySwizzledData((stride + tile_size_x - 1) / tile_size_x, + (height + tile_size_y - 1) / tile_size_y, depth, bytes_per_pixel, bytes_per_pixel, Memory::GetPointer(addr), gl_buffer, false, block_height, block_depth); } @@ -442,6 +445,8 @@ static constexpr GLConversionArray morton_to_gl_fns = { MortonCopy<true, PixelFormat::ASTC_2D_8X8_SRGB>, MortonCopy<true, PixelFormat::ASTC_2D_8X5_SRGB>, MortonCopy<true, PixelFormat::ASTC_2D_5X4_SRGB>, + MortonCopy<true, PixelFormat::ASTC_2D_5X5>, + MortonCopy<true, PixelFormat::ASTC_2D_5X5_SRGB>, MortonCopy<true, PixelFormat::Z32F>, MortonCopy<true, PixelFormat::Z16>, MortonCopy<true, PixelFormat::Z24S8>, @@ -510,6 +515,8 @@ static constexpr GLConversionArray gl_to_morton_fns = { nullptr, nullptr, nullptr, + nullptr, + nullptr, MortonCopy<false, PixelFormat::Z32F>, MortonCopy<false, PixelFormat::Z16>, MortonCopy<false, PixelFormat::Z24S8>, |