From 5dd10dfb1a77df67f0e9b599470d445f6f52bb2b Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 8 Sep 2019 15:10:19 -0700 Subject: Updated ICommandQueueD3D12::Wait method to return HRESULT --- Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h | 2 +- Graphics/GraphicsEngineD3D12/src/CommandQueueD3D12Impl.cpp | 4 ++-- Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h index e1d29f2e..16b9b317 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h @@ -58,7 +58,7 @@ public: virtual void SignalFence(ID3D12Fence* pFence, Uint64 Value)override final; - virtual void Wait(ID3D12Fence* pFence, Uint64 Value)override final; + virtual HRESULT Wait(ID3D12Fence* pFence, Uint64 Value)override final; private: // A value that will be signaled by the command queue next diff --git a/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h b/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h index 5ad649fa..7df57a3a 100644 --- a/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h +++ b/Graphics/GraphicsEngineD3D12/interface/CommandQueueD3D12.h @@ -58,7 +58,7 @@ public: virtual void SignalFence(ID3D12Fence* pFence, Uint64 Value) = 0; /// Waits until the specified fence reaches or exceeds the specified value. - virtual void Wait(ID3D12Fence* pFence, Uint64 Value) = 0; + virtual HRESULT Wait(ID3D12Fence* pFence, Uint64 Value) = 0; }; } diff --git a/Graphics/GraphicsEngineD3D12/src/CommandQueueD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/CommandQueueD3D12Impl.cpp index df423816..23bf48ae 100644 --- a/Graphics/GraphicsEngineD3D12/src/CommandQueueD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/CommandQueueD3D12Impl.cpp @@ -99,10 +99,10 @@ void CommandQueueD3D12Impl::SignalFence(ID3D12Fence* pFence, Uint64 Value) m_pd3d12CmdQueue->Signal(pFence, Value); } -void CommandQueueD3D12Impl::Wait(ID3D12Fence* pFence, Uint64 Value) +HRESULT CommandQueueD3D12Impl::Wait(ID3D12Fence* pFence, Uint64 Value) { std::lock_guard Lock(m_QueueMtx); - m_pd3d12CmdQueue->Wait(pFence, Value); + return m_pd3d12CmdQueue->Wait(pFence, Value); } } diff --git a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp index e7ee520e..0b04c709 100644 --- a/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/RenderDeviceD3D12Impl.cpp @@ -204,7 +204,8 @@ void RenderDeviceD3D12Impl::WaitForFence(Uint32 QueueIndex, IFence* pFence, Uint auto* pFenceD3D12Impl = ValidatedCast(pFence); auto* pd3d12Fence = pFenceD3D12Impl->GetD3D12Fence(); - m_CommandQueues[QueueIndex].CmdQueue->Wait(pd3d12Fence, Value); + auto res = m_CommandQueues[QueueIndex].CmdQueue->Wait(pd3d12Fence, Value); + VERIFY_EXPR(res == S_OK); (void)res; PurgeReleaseQueue(QueueIndex); } -- cgit v1.2.3