Skip to content

Commit

Permalink
Fix race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Jun 29, 2024
1 parent 13289aa commit 81240a9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/XenoAtom.Graphics/Vk/VkCommandList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ public void CommandBufferSubmitted(VkCommandBuffer cb)
EnsureBegin();
AddReference();

_submittedStagingInfos.Add(cb, _currentStagingInfo!);
lock (_stagingLock)
{
_submittedStagingInfos.Add(cb, _currentStagingInfo!);
}
_currentStagingInfo = null;
}

Expand Down Expand Up @@ -477,7 +480,11 @@ public override void End()
}

vkEndCommandBuffer(_cb);
_submittedCommandBuffers.Add(_cb);

lock (_submittedCommandBuffers)
{
_submittedCommandBuffers.Add(_cb);
}
}

protected override void SetFramebufferCore(Framebuffer fb)
Expand Down

0 comments on commit 81240a9

Please sign in to comment.