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/cuda/render-cuda.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tools/gfx/cuda/render-cuda.cpp') diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp index 9b99e5f26..ec6f1212a 100644 --- a/tools/gfx/cuda/render-cuda.cpp +++ b/tools/gfx/cuda/render-cuda.cpp @@ -1021,6 +1021,13 @@ public: } virtual SLANG_NO_THROW void SLANG_MCALL close() override {} + + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(NativeHandle* outHandle) override + { + *outHandle = 0; + return SLANG_OK; + } }; class CommandQueueImpl @@ -1079,6 +1086,13 @@ public: SLANG_CUDA_HANDLE_ERROR(resultCode); } + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(NativeHandle* outHandle) override + { + *outHandle = (uint64_t)stream; + return SLANG_OK; + } + public: void setPipelineState(IPipelineState* state) { -- cgit v1.2.3