Browse Source

[video_core] Bypass mip level assertion to ASSERT_MSG (#2914)

This will bypass the check and continue execution,
preventing crashes in cases where games (like CTGP-DX) may request
more mip levels than supported. This is a temporary solution to bypass
instead of ending the crashing when asserts fail.

Co-authored-by: MaranBr <maranbr@outlook.com>

Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2914
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
pull/2917/head v0.0.4-rc2.test
JPikachu 2 months ago
committed by crueter
parent
commit
aa93e0cbb1
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 2
      src/video_core/texture_cache/util.cpp

2
src/video_core/texture_cache/util.cpp

@ -647,6 +647,8 @@ LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept {
return {}; return {};
} }
ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS));
if (info.resources.levels > static_cast<s32>(MAX_MIP_LEVELS))
return {};
const LevelInfo level_info = MakeLevelInfo(info); const LevelInfo level_info = MakeLevelInfo(info);
LevelArray offsets{}; LevelArray offsets{};
u32 offset = 0; u32 offset = 0;

Loading…
Cancel
Save