mod private
{
use crate::*;
#[ derive( Default, Clone ) ]
pub struct SamplerBindingLayout
{
s_type : Option< GpuSamplerBindingType >,
}
impl SamplerBindingLayout
{
pub fn new() -> Self
{
Self::default()
}
pub fn set_type( mut self, s_type : web_sys::GpuSamplerBindingType ) -> Self
{
self.s_type = Some( s_type );
self
}
pub fn filtering( mut self ) -> Self
{
self.s_type = Some( GpuSamplerBindingType::Filtering );
self
}
pub fn non_filtering( mut self ) -> Self
{
self.s_type = Some( GpuSamplerBindingType::NonFiltering );
self
}
pub fn comparison( mut self ) -> Self
{
self.s_type = Some( GpuSamplerBindingType::Comparison );
self
}
}
impl From< SamplerBindingLayout > for web_sys::GpuSamplerBindingLayout
{
fn from( value: SamplerBindingLayout ) -> Self
{
let layout = web_sys::GpuSamplerBindingLayout::new();
if let Some( value ) = value.s_type { layout.set_type( value ); }
layout
}
}
}
crate::mod_interface!
{
orphan use
{
SamplerBindingLayout
};
}