summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cuda/cuda-command-buffer.cpp
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-07-25 13:36:43 -0700
committerGitHub <noreply@github.com>2022-07-25 13:36:43 -0700
commitce6e946f6f4882aba8a62392ae791c948633e2e3 (patch)
treefde46847900ef80ee111a6b612f7e0931b15fdf2 /tools/gfx/cuda/cuda-command-buffer.cpp
parent129294a58d2a51308af78ad5d8d436c026863259 (diff)
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
Diffstat (limited to 'tools/gfx/cuda/cuda-command-buffer.cpp')
-rw-r--r--tools/gfx/cuda/cuda-command-buffer.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/tools/gfx/cuda/cuda-command-buffer.cpp b/tools/gfx/cuda/cuda-command-buffer.cpp
new file mode 100644
index 000000000..efb2486f4
--- /dev/null
+++ b/tools/gfx/cuda/cuda-command-buffer.cpp
@@ -0,0 +1,62 @@
+// cuda-command-buffer.cpp
+#include "cuda-command-buffer.h"
+
+namespace gfx
+{
+#ifdef GFX_ENABLE_CUDA
+using namespace Slang;
+
+namespace cuda
+{
+
+ICommandBuffer* CommandBufferImpl::getInterface(const Guid& guid)
+{
+ if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_ICommandBuffer)
+ return static_cast<ICommandBuffer*>(this);
+ return nullptr;
+}
+
+void CommandBufferImpl::init(DeviceImpl* device, TransientResourceHeapBase* transientHeap)
+{
+ m_device = device;
+ m_transientHeap = transientHeap;
+}
+
+SLANG_NO_THROW void SLANG_MCALL CommandBufferImpl::encodeRenderCommands(
+ IRenderPassLayout* renderPass,
+ IFramebuffer* framebuffer,
+ IRenderCommandEncoder** outEncoder)
+{
+ SLANG_UNUSED(renderPass);
+ SLANG_UNUSED(framebuffer);
+ *outEncoder = nullptr;
+}
+
+SLANG_NO_THROW void SLANG_MCALL
+ CommandBufferImpl::encodeResourceCommands(IResourceCommandEncoder** outEncoder)
+{
+ m_resourceCommandEncoder.init(this);
+ *outEncoder = &m_resourceCommandEncoder;
+}
+
+SLANG_NO_THROW void SLANG_MCALL
+ CommandBufferImpl::encodeComputeCommands(IComputeCommandEncoder** outEncoder)
+{
+ m_computeCommandEncoder.init(this);
+ *outEncoder = &m_computeCommandEncoder;
+}
+
+SLANG_NO_THROW void SLANG_MCALL
+ CommandBufferImpl::encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder)
+{
+ *outEncoder = nullptr;
+}
+
+SLANG_NO_THROW Result SLANG_MCALL CommandBufferImpl::getNativeHandle(InteropHandle* outHandle)
+{
+ return SLANG_FAIL;
+}
+
+} // namespace cuda
+#endif
+} // namespace gfx