diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-07-25 13:36:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-25 13:36:43 -0700 |
| commit | ce6e946f6f4882aba8a62392ae791c948633e2e3 (patch) | |
| tree | fde46847900ef80ee111a6b612f7e0931b15fdf2 /tools/gfx/cuda/cuda-buffer.h | |
| parent | 129294a58d2a51308af78ad5d8d436c026863259 (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-buffer.h')
| -rw-r--r-- | tools/gfx/cuda/cuda-buffer.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/gfx/cuda/cuda-buffer.h b/tools/gfx/cuda/cuda-buffer.h new file mode 100644 index 000000000..838a06555 --- /dev/null +++ b/tools/gfx/cuda/cuda-buffer.h @@ -0,0 +1,39 @@ +// cuda-buffer.h +#pragma once +#include "cuda-base.h" +#include "cuda-context.h" + +namespace gfx +{ +#ifdef GFX_ENABLE_CUDA +using namespace Slang; + +namespace cuda +{ + +class BufferResourceImpl : public BufferResource +{ +public: + BufferResourceImpl(const Desc& _desc) + : BufferResource(_desc) + {} + + ~BufferResourceImpl(); + + uint64_t getBindlessHandle(); + + void* m_cudaExternalMemory = nullptr; + void* m_cudaMemory = nullptr; + + RefPtr<CUDAContext> m_cudaContext; + + virtual SLANG_NO_THROW DeviceAddress SLANG_MCALL getDeviceAddress() override; + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeResourceHandle(InteropHandle* outHandle) 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 cuda +#endif +} // namespace gfx |
