mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-30 15:50:05 -06:00
Fix buffers getting copied with a closed command list.
This commit is contained in:
@@ -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<RenderTexture*, RenderTextureLayout> 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;
|
||||
|
||||
Reference in New Issue
Block a user