diff options
Diffstat (limited to 'tools/gfx/debug-layer/debug-command-buffer.cpp')
| -rw-r--r-- | tools/gfx/debug-layer/debug-command-buffer.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/gfx/debug-layer/debug-command-buffer.cpp b/tools/gfx/debug-layer/debug-command-buffer.cpp index aa9c6b8b8..f3c71cb77 100644 --- a/tools/gfx/debug-layer/debug-command-buffer.cpp +++ b/tools/gfx/debug-layer/debug-command-buffer.cpp @@ -22,6 +22,15 @@ DebugCommandBuffer::DebugCommandBuffer() m_rayTracingCommandEncoder.commandBuffer = this; } +ICommandBuffer* DebugCommandBuffer::getInterface(const Slang::Guid& guid) +{ + if (guid == GfxGUID::IID_ICommandBuffer || guid == GfxGUID::IID_ISlangUnknown) + return (DebugObject<ICommandBuffer>*)this; + if (guid == GfxGUID::IID_ICommandBufferD3D12) + return static_cast<ICommandBufferD3D12*>(this); + return nullptr; +} + void DebugCommandBuffer::encodeRenderCommands( IRenderPassLayout* renderPass, IFramebuffer* framebuffer, @@ -127,6 +136,30 @@ Result DebugCommandBuffer::getNativeHandle(InteropHandle* outHandle) return baseObject->getNativeHandle(outHandle); } +void DebugCommandBuffer::invalidateDescriptorHeapBinding() +{ + SLANG_GFX_API_FUNC; + ComPtr<ICommandBufferD3D12> cmdBuf; + if (SLANG_FAILED(baseObject->queryInterface(SlangUUID SLANG_UUID_ICommandBufferD3D12, (void**)cmdBuf.writeRef()))) + { + GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide ICommandBufferD3D12 interface."); + return; + } + return cmdBuf->invalidateDescriptorHeapBinding(); +} + +void DebugCommandBuffer::ensureInternalDescriptorHeapsBound() +{ + SLANG_GFX_API_FUNC; + ComPtr<ICommandBufferD3D12> cmdBuf; + if (SLANG_FAILED(baseObject->queryInterface(SlangUUID SLANG_UUID_ICommandBufferD3D12, (void**)cmdBuf.writeRef()))) + { + GFX_DIAGNOSE_ERROR("The current command buffer implementation does not provide ICommandBufferD3D12 interface."); + return; + } + return cmdBuf->ensureInternalDescriptorHeapsBound(); +} + void DebugCommandBuffer::checkEncodersClosedBeforeNewEncoder() { if (m_renderCommandEncoder.isOpen || m_resourceCommandEncoder.isOpen || |
