From d06a78d935b2743494d47ed5cd3f36e38ac9c5ac Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 3 Feb 2022 19:17:30 -0800 Subject: Add gfx interop to allow more direct D3D12 usage scenarios. (#2117) * Add gfx interop to allow more direct D3D12 usage scenarios. * Fix compile error in win32. * gfx: Implement IFence::getNativeHandle() on d3d12. * More GFX-D3D interop interface. * Fix cuda. Co-authored-by: Yong He --- tools/gfx/debug-layer.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tools/gfx/debug-layer.h') diff --git a/tools/gfx/debug-layer.h b/tools/gfx/debug-layer.h index 94f3e3f14..069895f9b 100644 --- a/tools/gfx/debug-layer.h +++ b/tools/gfx/debug-layer.h @@ -225,6 +225,7 @@ public: public: IResourceView* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW Desc* SLANG_MCALL getViewDesc() override; + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outNativeHandle) override; }; class DebugAccelerationStructure : public DebugObject @@ -235,6 +236,8 @@ public: public: IAccelerationStructure* getInterface(const Slang::Guid& guid); virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(InteropHandle* outNativeHandle) override; virtual SLANG_NO_THROW Desc* SLANG_MCALL getViewDesc() override; }; @@ -245,7 +248,8 @@ public: public: ISamplerState* getInterface(const Slang::Guid& guid); -}; + virtual SLANG_NO_THROW Result SLANG_MCALL + getNativeHandle(InteropHandle* outNativeHandle) override;}; struct ShaderOffsetKey { @@ -574,7 +578,8 @@ public: virtual SLANG_NO_THROW void SLANG_MCALL encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder) override; virtual SLANG_NO_THROW void SLANG_MCALL close() override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL resetDescriptorHeaps() override; private: void checkEncodersClosedBeforeNewEncoder(); @@ -597,7 +602,7 @@ public: virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override; virtual SLANG_NO_THROW Result SLANG_MCALL waitForFenceValuesOnDevice( uint32_t fenceCount, IFence** fences, uint64_t* waitValues) override; - virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(NativeHandle* outHandle) override; + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; }; class DebugFramebuffer @@ -635,6 +640,7 @@ public: public: IPipelineState* getInterface(const Slang::Guid& guid); + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; }; class DebugRenderPassLayout : public DebugObject -- cgit v1.2.3