diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 65d362d..338ff95 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -563,6 +563,14 @@ static void DestructTempResources() } static std::thread::id g_mainThreadId; +static std::thread::id g_presentThreadId = std::this_thread::get_id(); + +PPC_FUNC_IMPL(__imp__sub_824ECA00); +PPC_FUNC(sub_824ECA00) +{ + g_presentThreadId = std::this_thread::get_id(); + __imp__sub_824ECA00(ctx, base); +} static ankerl::unordered_dense::map g_barrierMap; @@ -1814,7 +1822,7 @@ static void UnlockBuffer(GuestBuffer* buffer) { if (!buffer->lockedReadOnly) { - if (std::this_thread::get_id() == g_mainThreadId) + if (std::this_thread::get_id() == g_presentThreadId) { RenderCommand cmd; cmd.type = (sizeof(T) == 2) ? RenderCommandType::UnlockBuffer16 : RenderCommandType::UnlockBuffer32;