summaryrefslogtreecommitdiffstats
path: root/tools/gfx/immediate-renderer-base.cpp
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2021-10-01 13:08:25 -0700
committerGitHub <noreply@github.com>2021-10-01 13:08:25 -0700
commit35bca4cc432613af3926da3bed217a6baa9cbd26 (patch)
treee07b9f779ea950666c2960c44eefdab7258ad312 /tools/gfx/immediate-renderer-base.cpp
parent6c6200f547c7387598743b23bb3c8f0d375d9494 (diff)
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
Diffstat (limited to 'tools/gfx/immediate-renderer-base.cpp')
-rw-r--r--tools/gfx/immediate-renderer-base.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/gfx/immediate-renderer-base.cpp b/tools/gfx/immediate-renderer-base.cpp
index fbe5ad423..e87c1e558 100644
--- a/tools/gfx/immediate-renderer-base.cpp
+++ b/tools/gfx/immediate-renderer-base.cpp
@@ -277,6 +277,13 @@ public:
virtual SLANG_NO_THROW void SLANG_MCALL close() override { }
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ getNativeHandle(NativeHandle* outHandle)
+ {
+ *outHandle = 0;
+ return SLANG_OK;
+ }
+
void execute()
{
for (auto& cmd : m_writer.m_commands)
@@ -412,6 +419,12 @@ public:
}
virtual SLANG_NO_THROW void SLANG_MCALL wait() override { getRenderer()->waitForGpu(); }
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ getNativeHandle(NativeHandle* outHandle) override
+ {
+ return getRenderer()->m_queue->getNativeHandle(outHandle);
+ }
};
using TransientResourceHeapImpl =