summaryrefslogtreecommitdiffstats
path: root/tools/gfx/cuda/render-cuda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/cuda/render-cuda.cpp')
-rw-r--r--tools/gfx/cuda/render-cuda.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/gfx/cuda/render-cuda.cpp b/tools/gfx/cuda/render-cuda.cpp
index 383ccc924..b29f7f7e4 100644
--- a/tools/gfx/cuda/render-cuda.cpp
+++ b/tools/gfx/cuda/render-cuda.cpp
@@ -12,6 +12,7 @@
#include "slang-com-helper.h"
#include "../command-writer.h"
#include "../renderer-shared.h"
+#include "../simple-transient-resource-heap.h"
#include "../slang-context.h"
# ifdef RENDER_TEST_OPTIX
@@ -989,6 +990,7 @@ public:
return nullptr;
}
public:
+ void init(CUDADevice* device) { SLANG_UNUSED(device); }
virtual SLANG_NO_THROW void SLANG_MCALL encodeRenderCommands(
IRenderPassLayout* renderPass,
IFramebuffer* framebuffer,
@@ -1147,13 +1149,6 @@ public:
{
return m_desc;
}
- virtual SLANG_NO_THROW Result SLANG_MCALL
- createCommandBuffer(ICommandBuffer** outCommandBuffer) override
- {
- RefPtr<CommandBufferImpl> result = new CommandBufferImpl();
- *outCommandBuffer = result.detach();
- return SLANG_OK;
- }
virtual SLANG_NO_THROW void SLANG_MCALL
executeCommandBuffers(uint32_t count, ICommandBuffer* const* commandBuffers) override
@@ -1320,6 +1315,8 @@ public:
}
};
+ using TransientResourceHeapImpl = SimpleTransientResourceHeap<CUDADevice, CommandBufferImpl>;
+
public:
~CUDADevice()
{
@@ -1921,6 +1918,16 @@ public:
}
public:
+ virtual SLANG_NO_THROW Result SLANG_MCALL createTransientResourceHeap(
+ const ITransientResourceHeap::Desc& desc,
+ ITransientResourceHeap** outHeap) override
+ {
+ RefPtr<TransientResourceHeapImpl> result = new TransientResourceHeapImpl();
+ SLANG_RETURN_ON_FAIL(result->init(this, desc));
+ *outHeap = result.detach();
+ return SLANG_OK;
+ }
+
virtual SLANG_NO_THROW Result SLANG_MCALL
createCommandQueue(const ICommandQueue::Desc& desc, ICommandQueue** outQueue) override
{