From ce6e946f6f4882aba8a62392ae791c948633e2e3 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Mon, 25 Jul 2022 13:36:43 -0700 Subject: Split render-cuda.cpp into smaller files (#2334) * render-cuda split, compile errors galore due to missing includes etc. * render-cuda split and fully compiles * Ran premake.bat to disable cuda; Added all new files * Removed render-cuda files * CI fixes * Rerun CI --- tools/gfx/cuda/cuda-command-buffer.h | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tools/gfx/cuda/cuda-command-buffer.h (limited to 'tools/gfx/cuda/cuda-command-buffer.h') diff --git a/tools/gfx/cuda/cuda-command-buffer.h b/tools/gfx/cuda/cuda-command-buffer.h new file mode 100644 index 000000000..76d9aa01f --- /dev/null +++ b/tools/gfx/cuda/cuda-command-buffer.h @@ -0,0 +1,49 @@ +// cuda-command-buffer.h +#pragma once +#include "cuda-base.h" +#include "cuda-command-encoder.h" + +namespace gfx +{ +#ifdef GFX_ENABLE_CUDA +using namespace Slang; + +namespace cuda +{ + +class CommandBufferImpl + : public ICommandBuffer + , public CommandWriter + , public ComObject +{ +public: + SLANG_COM_OBJECT_IUNKNOWN_ALL + ICommandBuffer* getInterface(const Guid& guid); + +public: + DeviceImpl* m_device; + TransientResourceHeapBase* m_transientHeap; + ResourceCommandEncoderImpl m_resourceCommandEncoder; + ComputeCommandEncoderImpl m_computeCommandEncoder; + + void init(DeviceImpl* device, TransientResourceHeapBase* transientHeap); + virtual SLANG_NO_THROW void SLANG_MCALL encodeRenderCommands( + IRenderPassLayout* renderPass, + IFramebuffer* framebuffer, + IRenderCommandEncoder** outEncoder) override; + + virtual SLANG_NO_THROW void SLANG_MCALL + encodeResourceCommands(IResourceCommandEncoder** outEncoder) override; + virtual SLANG_NO_THROW void SLANG_MCALL + encodeComputeCommands(IComputeCommandEncoder** outEncoder) override; + 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(InteropHandle* outHandle) override; +}; + +} // namespace cuda +#endif +} // namespace gfx -- cgit v1.2.3