summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan/vk-sampler.cpp
blob: ee9357609e6b815aedb7a5a5a42655c7c5d3fad8 (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
// vk-sampler.cpp
#include "vk-sampler.h"

namespace gfx
{

using namespace Slang;

namespace vk
{

SamplerStateImpl::SamplerStateImpl(DeviceImpl* device)
    : m_device(device)
{
}

SamplerStateImpl::~SamplerStateImpl()
{
    m_device->m_api.vkDestroySampler(m_device->m_api.m_device, m_sampler, nullptr);
}

Result SamplerStateImpl::getNativeHandle(InteropHandle* outHandle)
{
    outHandle->api = InteropHandleAPI::Vulkan;
    outHandle->handleValue = (uint64_t)(m_sampler);
    return SLANG_OK;
}

} // namespace vk
} // namespace gfx