diff --git a/src/d3d11/d3d11_context.h b/src/d3d11/d3d11_context.h index c8620a9e..3776ae61 100644 --- a/src/d3d11/d3d11_context.h +++ b/src/d3d11/d3d11_context.h @@ -700,6 +700,10 @@ namespace dxvk { VkImageLayout OldLayout, VkImageLayout NewLayout); + D3D10DeviceLock LockContext() { + return m_multithread.AcquireLock(); + } + protected: D3D11Device* const m_parent; @@ -917,10 +921,6 @@ namespace dxvk { return pShader != nullptr ? pShader->GetCommonShader() : nullptr; } - D3D10DeviceLock LockContext() { - return m_multithread.AcquireLock(); - } - template void EmitCs(Cmd&& command) { m_cmdData = nullptr; diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index eaedcf37..7cc89725 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -368,6 +368,8 @@ namespace dxvk { D3D11ImmediateContext* pContext, const vk::PresenterSync& Sync, uint32_t FrameId) { + auto lock = pContext->LockContext(); + // Present from CS thread so that we don't // have to synchronize with it first. m_presentStatus.result = VK_NOT_READY;