From ed37dcbc175d07134cb0493f5e379a19e97c82f5 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Wed, 27 Jul 2022 15:53:36 -0700 Subject: Split render-cpu into smaller files (#2340) * render-cpu split, does not compile * split finished, one compile error * added missing include and missing destructor implementation * Rerun TeamCity CI --- tools/gfx/cpu/cpu-buffer.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tools/gfx/cpu/cpu-buffer.h (limited to 'tools/gfx/cpu/cpu-buffer.h') diff --git a/tools/gfx/cpu/cpu-buffer.h b/tools/gfx/cpu/cpu-buffer.h new file mode 100644 index 000000000..6273b18b9 --- /dev/null +++ b/tools/gfx/cpu/cpu-buffer.h @@ -0,0 +1,36 @@ +// cpu-buffer.h +#pragma once +#include "cpu-base.h" + +namespace gfx +{ +using namespace Slang; + +namespace cpu +{ + +class BufferResourceImpl : public BufferResource +{ +public: + BufferResourceImpl(const Desc& _desc) + : BufferResource(_desc) + {} + + ~BufferResourceImpl(); + + Result init(); + + Result setData(size_t offset, size_t size, void const* data); + + void* m_data = nullptr; + + virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override; + + virtual SLANG_NO_THROW Result SLANG_MCALL + map(MemoryRange* rangeToRead, void** outPointer) override; + + virtual SLANG_NO_THROW Result SLANG_MCALL unmap(MemoryRange* writtenRange) override; +}; + +} // namespace cpu +} // namespace gfx -- cgit v1.2.3