psemek/libs/wgpu/source/sampler.cpp
lisyarus 45fbc7399c
All checks were successful
Run tests / Run tests (push) Successful in 7m47s
Update to wgpu-native v29.0.1.1
2026-07-10 17:40:56 +03:00

33 lines
845 B
C++

#include <psemek/wgpu/sampler.hpp>
#include <psemek/wgpu/chained_struct.hpp>
#include <psemek/wgpu/detail/string_view.hpp>
#include <psemek/wgpu/external/webgpu.h>
#include <psemek/wgpu/external/wgpu.h>
namespace psemek::wgpu
{
void sampler::set_label(std::string const & label)
{
wgpuSamplerSetLabel((WGPUSampler)get(), detail::to_string_view(label));
}
void sampler::reference(void * ptr)
{
wgpuSamplerAddRef((WGPUSampler)ptr);
}
void sampler::release(void * ptr)
{
wgpuSamplerRelease((WGPUSampler)ptr);
}
detail::chained_struct_ptr to_chained_struct(sampler::extras const & value)
{
WGPUSamplerDescriptorExtras chained;
chained.chain.sType = (WGPUSType)WGPUSType_SamplerDescriptorExtras;
chained.samplerBorderColor = (WGPUSamplerBorderColor)value.border_color;
return detail::make_chained_struct(chained);
}
}