From 35bca4cc432613af3926da3bed217a6baa9cbd26 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Fri, 1 Oct 2021 13:08:25 -0700 Subject: Add getNativeHandle() to ICommandQueue and ICommandBuffer (#1952) * Added support for getting command buffer and command queue handles to ICommandBuffer and ICommandQueue; D3D12Device, VkDevice, and DebugDevice modifieid to implement this new functionality; immediate-renderer-base.cpp also modified to implement the new functions * Removed excess boilerplate * Changed readRef() to get() in D3D12 getNativeHandle() implementation for ICommandBuffer and ICommandQueue * Added unit tests for new getNativeHandle() implementations, unfinished * Queue test added; Minor cleanup changes * getBufferHandleTestImpl() now closes the command buffer before returning * Added getNativeHandle() implementations to CUDADevice * Added comment clarifying that the Vulkan check is checking for a null handle, which is defined to be 0 --- tools/gfx/debug-layer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/gfx/debug-layer.cpp') diff --git a/tools/gfx/debug-layer.cpp b/tools/gfx/debug-layer.cpp index 3e22bd510..74b319a08 100644 --- a/tools/gfx/debug-layer.cpp +++ b/tools/gfx/debug-layer.cpp @@ -814,6 +814,11 @@ void DebugCommandBuffer::close() baseObject->close(); } +Result DebugCommandBuffer::getNativeHandle(NativeHandle* outHandle) +{ + return baseObject->getNativeHandle(outHandle); +} + void DebugCommandBuffer::checkEncodersClosedBeforeNewEncoder() { if (m_renderCommandEncoder.isOpen || m_resourceCommandEncoder.isOpen || @@ -1160,6 +1165,11 @@ void DebugCommandQueue::executeCommandBuffers(uint32_t count, ICommandBuffer* co void DebugCommandQueue::wait() { baseObject->wait(); } +Result DebugCommandQueue::getNativeHandle(NativeHandle* outHandle) +{ + return baseObject->getNativeHandle(outHandle); +} + Result DebugTransientResourceHeap::synchronizeAndReset() { SLANG_GFX_API_FUNC; -- cgit v1.2.3