summaryrefslogtreecommitdiffstats
path: root/tools/gfx/metal/metal-resource-views.cpp
blob: 2f8a4b16e5f95d8a4ecfac018723e3eea6c186f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// metal-resource-views.cpp
#include "metal-resource-views.h"

namespace gfx
{

using namespace Slang;

namespace metal
{

TextureResourceViewImpl::~TextureResourceViewImpl() {}

Result TextureResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
{
    outHandle->api = InteropHandleAPI::Metal;
    outHandle->handleValue = reinterpret_cast<uintptr_t>(m_textureView.get());
    return SLANG_OK;
}

BufferResourceViewImpl::~BufferResourceViewImpl() {}

Result BufferResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
{
    outHandle->api = InteropHandleAPI::Metal;
    outHandle->handleValue = reinterpret_cast<uintptr_t>(m_buffer->m_buffer.get());
    return SLANG_OK;
}

TexelBufferResourceViewImpl::TexelBufferResourceViewImpl(DeviceImpl* device)
    : ResourceViewImpl(ViewType::TexelBuffer, device)
{
}

TexelBufferResourceViewImpl::~TexelBufferResourceViewImpl() {}

Result TexelBufferResourceViewImpl::getNativeHandle(InteropHandle* outHandle)
{
    return SLANG_E_NOT_IMPLEMENTED;
}

DeviceAddress AccelerationStructureImpl::getDeviceAddress()
{
    return 0;
}

Result AccelerationStructureImpl::getNativeHandle(InteropHandle* outHandle)
{
    return SLANG_E_NOT_IMPLEMENTED;
}

AccelerationStructureImpl::~AccelerationStructureImpl() {}

} // namespace metal
} // namespace gfx