From 0890fd8f2e485bfdd93ff6227be08ff4142e55d1 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 11 Mar 2022 11:57:53 -0800 Subject: gfx: Add `ITransientResourceHeap::finish()` to avoid `Signal` after every queue submit. (#2158) Co-authored-by: Yong He --- slang-gfx.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'slang-gfx.h') diff --git a/slang-gfx.h b/slang-gfx.h index e9d33bc98..5350444e9 100644 --- a/slang-gfx.h +++ b/slang-gfx.h @@ -1890,8 +1890,17 @@ public: uint32_t constantBufferDescriptorCount; uint32_t accelerationStructureDescriptorCount; }; + + // Waits until GPU commands issued before last call to `finish()` has been completed, and resets + // all transient resources holds by the heap. + // This method must be called before using the transient heap to issue new GPU commands. + // In most situations this method should be called at the beginning of each frame. virtual SLANG_NO_THROW Result SLANG_MCALL synchronizeAndReset() = 0; + // Must be called when the application has done using this heap to issue commands. In most situations + // this method should be called at the end of each frame. + virtual SLANG_NO_THROW Result SLANG_MCALL finish() = 0; + // Command buffers are one-time use. Once it is submitted to the queue via // `executeCommandBuffers` a command buffer is no longer valid to be used any more. Command // buffers must be closed before submission. The current D3D12 implementation has a limitation -- cgit v1.2.3