From 43e1b7cdc70b2fcac8a3e8ee72f5bc91726f4ec5 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Thu, 26 May 2022 10:54:35 -0700 Subject: Split render-vk.h/.cpp into a set of smaller files (#2244) * Some preliminary work on splitting render-vk * render-vk split, tests currently crash on null reference * fixed circular include --- tools/gfx/vulkan/vk-sampler.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/gfx/vulkan/vk-sampler.cpp (limited to 'tools/gfx/vulkan/vk-sampler.cpp') diff --git a/tools/gfx/vulkan/vk-sampler.cpp b/tools/gfx/vulkan/vk-sampler.cpp new file mode 100644 index 000000000..e07cff753 --- /dev/null +++ b/tools/gfx/vulkan/vk-sampler.cpp @@ -0,0 +1,29 @@ +// 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 -- cgit v1.2.3