diff options
| author | Markus Wick <markus@selfnet.de> | 2021-06-10 21:07:27 +0200 |
|---|---|---|
| committer | Markus Wick <markus@selfnet.de> | 2021-06-10 21:07:27 +0200 |
| commit | 6755025310335abdb655c11fc65801fee99bb3d9 (patch) | |
| tree | 6e4dd0bc6f2feb5e10ac6f101883fd9cfaa27be5 /src/video_core/texture_cache/util.cpp | |
| parent | fa8a0065ca934275be816929ac3d08713bebd6e0 (diff) | |
Fix GCC undefined behavior sanitizer.
* Wrong alignment in u64 LOG_DEBUG -> memcpy.
* Huge shift exponent in stride calculation for linear buffer, unused result -> skipped.
* Large shift in buffer cache if word = 0, skip checking for set bits.
Non of those were critical, so this should not change any behavior.
At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
Diffstat (limited to 'src/video_core/texture_cache/util.cpp')
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 8c4a5523b..906604a39 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -647,6 +647,9 @@ u32 CalculateLayerSize(const ImageInfo& info) noexcept { } LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept { + if (info.type == ImageType::Linear) { + return {}; + } ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); const LevelInfo level_info = MakeLevelInfo(info); LevelArray offsets{}; |
