From 3e3a327fe4be8852400709f6b3c8677f10f075d8 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 8 Sep 2019 17:05:37 -0700 Subject: Renamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API version to 240027). Added FlushContext parameter to the methods --- Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h | 2 +- Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h | 2 +- Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 7 ++++--- Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index ef7124be..940529b4 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -156,7 +156,7 @@ public: virtual void SignalFence(IFence* pFence, Uint64 Value)override final; - virtual void Wait(IFence* pFence, Uint64 Value)override final; + virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; virtual ID3D11DeviceContext* GetD3D11DeviceContext()override final { return m_pd3d11DeviceContext; } diff --git a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h index bdfc5262..ad2e7986 100644 --- a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h @@ -58,7 +58,7 @@ public: m_PendingQueries.emplace_back(std::move(pCtx), std::move(pQuery), Value); } - void Wait(Uint64 Value); + void Wait(Uint64 Value, bool FlushCommands); private: struct PendingFenceData diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 1ccdc2e2..72e26117 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -1766,12 +1766,13 @@ namespace Diligent pFenceD3D11Impl->AddPendingQuery(m_pd3d11DeviceContext, std::move(pd3d11Query), Value); } - void DeviceContextD3D11Impl::Wait(IFence* pFence, Uint64 Value) + void DeviceContextD3D11Impl::WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext) { VERIFY(!m_bIsDeferred, "Fence can only be waited from immediate context"); - Flush(); + if (FlushContext) + Flush(); auto* pFenceD3D11Impl = ValidatedCast(pFence); - pFenceD3D11Impl->Wait(Value); + pFenceD3D11Impl->Wait(Value, FlushContext); } void DeviceContextD3D11Impl::ClearStateCache() diff --git a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp index e3bd2f4e..8ac63cb1 100644 --- a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp @@ -64,7 +64,7 @@ Uint64 FenceD3D11Impl :: GetCompletedValue() return m_LastCompletedFenceValue; } -void FenceD3D11Impl :: Wait(Uint64 Value) +void FenceD3D11Impl :: Wait(Uint64 Value, bool FlushCommands) { while (!m_PendingQueries.empty()) { @@ -73,7 +73,7 @@ void FenceD3D11Impl :: Wait(Uint64 Value) break; BOOL Data; - while (QueryData.pd3d11Ctx->GetData(QueryData.pd3d11Query, &Data, sizeof(Data), 0) != S_OK) + while (QueryData.pd3d11Ctx->GetData(QueryData.pd3d11Query, &Data, sizeof(Data), FlushCommands ? 0 : D3D11_ASYNC_GETDATA_DONOTFLUSH) != S_OK) std::this_thread::yield(); VERIFY_EXPR(Data == TRUE); -- cgit v1.2.3