summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:05:37 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:05:37 +0000
commit3e3a327fe4be8852400709f6b3c8677f10f075d8 (patch)
tree592193d248342b4a54a6d6b02d84c65f835d2e9d /Graphics/GraphicsEngineD3D11
parentD3D12 backend: fixed issue with fences not being signaled if there is no comm... (diff)
downloadDiligentCore-3e3a327fe4be8852400709f6b3c8677f10f075d8.tar.gz
DiligentCore-3e3a327fe4be8852400709f6b3c8677f10f075d8.zip
Renamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API version to 240027). Added FlushContext parameter to the methods
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h2
-rw-r--r--Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h2
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp7
-rw-r--r--Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp4
4 files changed, 8 insertions, 7 deletions
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<FenceD3D11Impl>(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);