diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2021-10-01 13:08:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-01 13:08:25 -0700 |
| commit | 35bca4cc432613af3926da3bed217a6baa9cbd26 (patch) | |
| tree | e07b9f779ea950666c2960c44eefdab7258ad312 /tools/gfx/vulkan/render-vk.cpp | |
| parent | 6c6200f547c7387598743b23bb3c8f0d375d9494 (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/vulkan/render-vk.cpp')
| -rw-r--r-- | tools/gfx/vulkan/render-vk.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/render-vk.cpp b/tools/gfx/vulkan/render-vk.cpp index 186c7eb40..7af7d086f 100644 --- a/tools/gfx/vulkan/render-vk.cpp +++ b/tools/gfx/vulkan/render-vk.cpp @@ -4492,6 +4492,13 @@ public: } vkAPI.vkEndCommandBuffer(m_commandBuffer); } + + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(NativeHandle* outHandle) override + { + *outHandle = (uint64_t)m_commandBuffer; + return SLANG_OK; + } }; class CommandQueueImpl @@ -4551,6 +4558,13 @@ public: vkAPI.vkQueueWaitIdle(m_queue); } + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(NativeHandle* outHandle) override + { + *outHandle = (uint64_t)m_queue; + return SLANG_OK; + } + virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override { return m_desc; |
