#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);
	}

}
