yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
1.5 KiB62 linesraw
1// cuda-command-buffer.cpp
2#include "cuda-command-buffer.h"
3
4namespace gfx
5{
6#ifdef GFX_ENABLE_CUDA
7using namespace Slang;
8
9namespace cuda
10{
11
12ICommandBuffer* CommandBufferImpl::getInterface(const Guid& guid)
13{
14    if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_ICommandBuffer)
15        return static_cast<ICommandBuffer*>(this);
16    return nullptr;
17}
18
19void CommandBufferImpl::init(DeviceImpl* device, TransientResourceHeapBase* transientHeap)
20{
21    m_device = device;
22    m_transientHeap = transientHeap;
23}
24
25SLANG_NO_THROW void SLANG_MCALL CommandBufferImpl::encodeRenderCommands(
26    IRenderPassLayout* renderPass,
27    IFramebuffer* framebuffer,
28    IRenderCommandEncoder** outEncoder)
29{
30    SLANG_UNUSED(renderPass);
31    SLANG_UNUSED(framebuffer);
32    *outEncoder = nullptr;
33}
34
35SLANG_NO_THROW void SLANG_MCALL
36CommandBufferImpl::encodeResourceCommands(IResourceCommandEncoder** outEncoder)
37{
38    m_resourceCommandEncoder.init(this);
39    *outEncoder = &m_resourceCommandEncoder;
40}
41
42SLANG_NO_THROW void SLANG_MCALL
43CommandBufferImpl::encodeComputeCommands(IComputeCommandEncoder** outEncoder)
44{
45    m_computeCommandEncoder.init(this);
46    *outEncoder = &m_computeCommandEncoder;
47}
48
49SLANG_NO_THROW void SLANG_MCALL
50CommandBufferImpl::encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder)
51{
52    *outEncoder = nullptr;
53}
54
55SLANG_NO_THROW Result SLANG_MCALL CommandBufferImpl::getNativeHandle(InteropHandle* outHandle)
56{
57    return SLANG_FAIL;
58}
59
60} // namespace cuda
61#endif
62} // namespace gfx