diff options
author | Squall Leonhart <danialhorton@hotmail.com> | 2023-10-14 17:09:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-14 17:09:28 +0200 |
commit | b57d98f847116be9fe624ee4f34a7e430818d11f (patch) | |
tree | adf70a10f6bea75d7a3b3dd83cf18f50b53ee0a2 /src/video_core/texture_cache/util.cpp | |
parent | Fix mistaken usage of info.block instead of level_info.block (diff) | |
download | yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar.gz yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar.bz2 yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar.lz yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar.xz yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.tar.zst yuzu-b57d98f847116be9fe624ee4f34a7e430818d11f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/util.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 652097a3d..ec4dd1f68 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -167,6 +167,13 @@ template <u32 GOB_EXTENT> } [[nodiscard]] constexpr Extent3D TileShift(const LevelInfo& info, u32 level) { + if (level == 0 && info.num_levels == 1) { + return Extent3D{ + .width = info.block.width, + .height = info.block.height, + .depth = info.block.depth, + }; + } const Extent3D blocks = NumLevelBlocks(info, level); return Extent3D{ .width = AdjustTileSize(info.block.width, GOB_SIZE_X, blocks.width), @@ -1293,9 +1300,9 @@ u32 MapSizeBytes(const ImageBase& image) { static_assert(CalculateLevelSize(LevelInfo{{1920, 1080, 1}, {0, 2, 0}, {1, 1}, 2, 0, 1}, 0) == 0x7f8000); -static_assert(CalculateLevelSize(LevelInfo{{32, 32, 1}, {0, 0, 4}, {1, 1}, 4, 0, 1}, 0) == 0x4000); +static_assert(CalculateLevelSize(LevelInfo{{32, 32, 1}, {0, 0, 4}, {1, 1}, 4, 0, 1}, 0) == 0x40000); -static_assert(CalculateLevelSize(LevelInfo{{128, 8, 1}, {0, 4, 0}, {1, 1}, 4, 0, 1}, 0) == 0x4000); +static_assert(CalculateLevelSize(LevelInfo{{128, 8, 1}, {0, 4, 0}, {1, 1}, 4, 0, 1}, 0) == 0x40000); static_assert(CalculateLevelOffset(PixelFormat::R8_SINT, {1920, 1080, 1}, {0, 2, 0}, 0, 7) == 0x2afc00); |