diff options
Diffstat (limited to 'tools/gfx/cpu/render-cpu.cpp')
| -rw-r--r-- | tools/gfx/cpu/render-cpu.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/gfx/cpu/render-cpu.cpp b/tools/gfx/cpu/render-cpu.cpp index fa31f7ee1..f0b612e2f 100644 --- a/tools/gfx/cpu/render-cpu.cpp +++ b/tools/gfx/cpu/render-cpu.cpp @@ -9,6 +9,7 @@ #include "../command-writer.h" #include "../renderer-shared.h" +#include "../simple-transient-resource-heap.h" #include "../slang-context.h" #define SLANG_PRELUDE_NAMESPACE slang_prelude @@ -1119,6 +1120,10 @@ private: return nullptr; } public: + void init(CPUDevice* device) + { + SLANG_UNUSED(device); + } virtual SLANG_NO_THROW void SLANG_MCALL encodeRenderCommands( IRenderPassLayout* renderPass, IFramebuffer* framebuffer, @@ -1273,13 +1278,6 @@ private: { 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 @@ -1400,6 +1398,8 @@ private: } }; + using TransientResourceHeapImpl = SimpleTransientResourceHeap<CPUDevice, CommandBufferImpl>; + public: ~CPUDevice() { @@ -1559,6 +1559,15 @@ public: *outQueue = queue.detach(); return SLANG_OK; } + 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 createSwapchain( const ISwapchain::Desc& desc, WindowHandle window, ISwapchain** outSwapchain) override { |
