Vulkan: Fix crash when a replaced texture fails to allocate

The out-of-VRAM retry path cleared plan.replaced but left plan.doReplace set.
GetMipSize() dereferences plan.replaced when doReplace is true, so the fallback
crashed instead of recovering. The common code sets both together.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGz54K3ZXa2Qzyc3aMEYyY
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-09-04 12:10:03 -06:00
1 parent 050cacbbdf
commit 79a48c7dbe
1 file changed
+3 -1
+3 -1
View File
@@ -740,8 +740,10 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) {
g_OSD.Show(OSDType::MESSAGE_WARNING, err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f);
}
// Turn off texture replacement for this texture.
// Turn off texture replacement for this texture. Both of these need to be reset, GetMipSize
// dereferences plan.replaced if doReplace is still set.
plan.replaced = nullptr;
plan.doReplace = false;
plan.createW /= plan.scaleFactor;
plan.createH /= plan.scaleFactor;