diff options
| author | 2018-10-26 16:17:29 -0400 | |
|---|---|---|
| committer | 2018-10-28 19:00:04 -0400 | |
| commit | 87f8181405cd09da15e7d1eb4a64024431fc0957 (patch) | |
| tree | 836d36964b76f98dc9d624ad1bb433815b447d31 /src | |
| parent | Fixed Block Resizing algorithm and Clang Format (diff) | |
| download | yuzu-87f8181405cd09da15e7d1eb4a64024431fc0957.tar.gz yuzu-87f8181405cd09da15e7d1eb4a64024431fc0957.tar.xz yuzu-87f8181405cd09da15e7d1eb4a64024431fc0957.zip | |
Fixed Invalid Image size and Mipmap calculation
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 11 |
1 files changed, 7 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 cbe5bf664..4d89d0f67 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -95,10 +95,13 @@ std::size_t SurfaceParams::InnerMipmapMemorySize(u32 mip_level, bool force_gl, b | |||
| 95 | const u32 compression_factor{GetCompressionFactor(pixel_format)}; | 95 | const u32 compression_factor{GetCompressionFactor(pixel_format)}; |
| 96 | const u32 bytes_per_pixel{GetBytesPerPixel(pixel_format)}; | 96 | const u32 bytes_per_pixel{GetBytesPerPixel(pixel_format)}; |
| 97 | u32 m_depth = (layer_only ? 1U : depth); | 97 | u32 m_depth = (layer_only ? 1U : depth); |
| 98 | u32 m_width = uncompressed ? width : std::max(1U, width / compression_factor); | 98 | u32 m_width = MipWidth(mip_level); |
| 99 | u32 m_height = uncompressed ? height : std::max(1U, height / compression_factor); | 99 | u32 m_height = MipHeight(mip_level); |
| 100 | m_width = std::max(1U, m_width >> mip_level); | 100 | m_width = uncompressed ? m_width |
| 101 | m_height = std::max(1U, m_height >> mip_level); | 101 | : std::max(1U, (m_width + compression_factor - 1) / compression_factor); |
| 102 | m_height = uncompressed | ||
| 103 | ? m_height | ||
| 104 | : std::max(1U, (m_height + compression_factor - 1) / compression_factor); | ||
| 102 | m_depth = std::max(1U, m_depth >> mip_level); | 105 | m_depth = std::max(1U, m_depth >> mip_level); |
| 103 | u32 m_block_height = MipBlockHeight(mip_level, m_height); | 106 | u32 m_block_height = MipBlockHeight(mip_level, m_height); |
| 104 | u32 m_block_depth = MipBlockDepth(mip_level); | 107 | u32 m_block_depth = MipBlockDepth(mip_level); |