yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
1.3 KiB55 linesraw
1// metal-resource-views.cpp
2#include "metal-resource-views.h"
3
4namespace gfx
5{
6
7using namespace Slang;
8
9namespace metal
10{
11
12TextureResourceViewImpl::~TextureResourceViewImpl() {}
13
14Result TextureResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
15{
16    outHandle->api = InteropHandleAPI::Metal;
17    outHandle->handleValue = reinterpret_cast<uintptr_t>(m_textureView.get());
18    return SLANG_OK;
19}
20
21BufferResourceViewImpl::~BufferResourceViewImpl() {}
22
23Result BufferResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
24{
25    outHandle->api = InteropHandleAPI::Metal;
26    outHandle->handleValue = reinterpret_cast<uintptr_t>(m_buffer->m_buffer.get());
27    return SLANG_OK;
28}
29
30TexelBufferResourceViewImpl::TexelBufferResourceViewImpl(DeviceImpl* device)
31    : ResourceViewImpl(ViewType::TexelBuffer, device)
32{
33}
34
35TexelBufferResourceViewImpl::~TexelBufferResourceViewImpl() {}
36
37Result TexelBufferResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
38{
39    return SLANG_E_NOT_IMPLEMENTED;
40}
41
42DeviceAddress AccelerationStructureImpl::getDeviceAddress()
43{
44    return 0;
45}
46
47Result AccelerationStructureImpl::getNativeHandle(InteropHandle* outHandle)
48{
49    return SLANG_E_NOT_IMPLEMENTED;
50}
51
52AccelerationStructureImpl::~AccelerationStructureImpl() {}
53
54} // namespace metal
55} // namespace gfx