summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:42:51 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-09-09 00:42:51 +0000
commitd06553e2b4700aa026acd4445a598eadf10dfb35 (patch)
tree534c3761a92cfb93d370b75f29f6b720a10c64a8 /Graphics/GraphicsEngineD3D12
parentRenamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API ver... (diff)
downloadDiligentCore-d06553e2b4700aa026acd4445a598eadf10dfb35.tar.gz
DiligentCore-d06553e2b4700aa026acd4445a598eadf10dfb35.zip
Added IDeviceContext::WaitForIdle() method (updated API version to 240028)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h6
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp2
3 files changed, 11 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
index b9f57598..0d973062 100644
--- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h
@@ -104,8 +104,6 @@ public:
virtual void ClearRenderTarget( ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final;
- virtual void Flush()override final;
-
virtual void UpdateBuffer(IBuffer* pBuffer,
Uint32 Offset,
Uint32 Size,
@@ -156,6 +154,10 @@ public:
virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final;
+ virtual void WaitForIdle()override final;
+
+ virtual void Flush()override final;
+
virtual void TransitionTextureState(ITexture *pTexture, D3D12_RESOURCE_STATES State)override final;
virtual void TransitionBufferState(IBuffer *pBuffer, D3D12_RESOURCE_STATES State)override final;
diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
index b31bedef..78e81459 100644
--- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp
@@ -1580,6 +1580,12 @@ namespace Diligent
pFenceD3D12->WaitForCompletion(Value);
}
+ void DeviceContextD3D12Impl::WaitForIdle()
+ {
+ VERIFY(!m_bIsDeferred, "Only immediate contexts can be idled");
+ Flush();
+ m_pDevice.RawPtr<RenderDeviceD3D12Impl>()->IdleCommandQueue(m_CommandQueueId, true);
+ }
void DeviceContextD3D12Impl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)
{
diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
index e34b637a..22ed2bc8 100644
--- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp
@@ -202,7 +202,7 @@ void RenderDeviceD3D12Impl::SignalFences(Uint32 QueueIndex, std::vector<std::pai
void RenderDeviceD3D12Impl::IdleGPU()
{
- IdleCommandQueues(true);
+ IdleAllCommandQueues(true);
ReleaseStaleResources();
}