From 0ee12b6164f0616281335c56a723b7e7d592092a Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Thu, 18 May 2023 00:29:58 -0500 Subject: [PATCH] VideoBackends:Metal: Allocate bounding box uploads on a cpu buffer AMD Metal drivers have a goofy bug where the bbox buffer stops being coherent with the cpu if you copy to it from a private (gpu) buffer and don't do anything else with it in that command buffer. --- Source/Core/VideoBackends/Metal/MTLBoundingBox.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/Metal/MTLBoundingBox.mm b/Source/Core/VideoBackends/Metal/MTLBoundingBox.mm index 3ff48a22c2..0bdcc9ef62 100644 --- a/Source/Core/VideoBackends/Metal/MTLBoundingBox.mm +++ b/Source/Core/VideoBackends/Metal/MTLBoundingBox.mm @@ -54,8 +54,7 @@ void Metal::BoundingBox::Write(u32 index, const std::vector& values) { @autoreleasepool { - StateTracker::Map map = g_state_tracker->Allocate(StateTracker::UploadBuffer::Other, size, - StateTracker::AlignMask::Other); + StateTracker::Map map = g_state_tracker->AllocateForTextureUpload(size); memcpy(map.cpu_buffer, values.data(), size); g_state_tracker->EndRenderPass(); id upload = [g_state_tracker->GetRenderCmdBuf() blitCommandEncoder];