yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
1.0 KiB45 linesraw
1// cuda-texture.h
2#pragma once
3#include "cuda-base.h"
4#include "cuda-context.h"
5
6namespace gfx
7{
8#ifdef GFX_ENABLE_CUDA
9using namespace Slang;
10
11namespace cuda
12{
13
14class TextureResourceImpl : public TextureResource
15{
16public:
17    TextureResourceImpl(const TextureResource::Desc& desc)
18        : TextureResource(desc)
19    {
20    }
21    ~TextureResourceImpl();
22
23    uint64_t getBindlessHandle();
24
25    // The texObject is for reading 'texture' like things. This is an opaque type, that's backed by
26    // a long long
27    CUtexObject m_cudaTexObj = CUtexObject();
28
29    // The surfObj is for reading/writing 'texture like' things, but not for sampling.
30    CUsurfObject m_cudaSurfObj = CUsurfObject();
31
32    CUarray m_cudaArray = CUarray();
33    CUmipmappedArray m_cudaMipMappedArray = CUmipmappedArray();
34
35    void* m_cudaExternalMemory = nullptr;
36
37    RefPtr<CUDAContext> m_cudaContext;
38
39    virtual SLANG_NO_THROW Result SLANG_MCALL
40    getNativeResourceHandle(InteropHandle* outHandle) override;
41};
42
43} // namespace cuda
44#endif
45} // namespace gfx