From 2a72421926f8b0afbf1d12278d41e5e9a102dbf1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 15:15:08 +0000 Subject: [PATCH] Give each fragment density map its own memory block On the Steam Frame the game crashed in Turnip while Dawn recorded an eye render pass, reading an unmapped address. Turnip reads a density map through a host mapping of its memory taken at bind time, and the maps were sub-allocated from blocks that Dawn's buffer upload fast path maps and unmaps. A dedicated allocation is never mapped or unmapped by Dawn. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019HBRGKTE1GnN2ah8gcZKr3 --- aurora-main/patches/dawn/aurora_fdm.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aurora-main/patches/dawn/aurora_fdm.inc b/aurora-main/patches/dawn/aurora_fdm.inc index 3f6e53b..578eade 100644 --- a/aurora-main/patches/dawn/aurora_fdm.inc +++ b/aurora-main/patches/dawn/aurora_fdm.inc @@ -93,8 +93,12 @@ MaybeError AuroraFdmUpload(Device* device, uint32_t width, uint32_t height, cons VkMemoryRequirements requirements; device->fn.GetImageMemoryRequirements(device->GetVkDevice(), map.image, &requirements); - DAWN_TRY_ASSIGN(map.memory, - device->GetResourceMemoryAllocator()->Allocate(requirements, MemoryKind::DeviceLocal)); + // A memory block of its own. Turnip reads a map through a host mapping of its memory, taken + // when the image is bound, and Dawn's buffer uploads map and unmap the shared blocks they + // sub-allocate from (Buffer::MapMemoryAndPerformOperation). An unmap there pulled the mapping + // from under a map sharing the block, and the next render pass read freed memory. + DAWN_TRY_ASSIGN(map.memory, device->GetResourceMemoryAllocator()->Allocate( + requirements, MemoryKind::DeviceLocal, /*forceDisableSubAllocation=*/true)); DAWN_TRY(CheckVkSuccess(device->fn.BindImageMemory(device->GetVkDevice(), map.image, ToBackend(map.memory.GetResourceHeap())->GetMemory(), map.memory.GetOffset()),