Some gltf improvements #4
|
@ -307,6 +307,7 @@ impl RenderTexture {
|
|||
}
|
||||
|
||||
/// Convert [`lyra_resource::WrappingMode`] to [`wgpu::AddressMode`]
|
||||
#[inline(always)]
|
||||
fn res_wrap_to_wgpu(wmode: WrappingMode) -> wgpu::AddressMode {
|
||||
match wmode {
|
||||
WrappingMode::ClampToEdge => wgpu::AddressMode::ClampToEdge,
|
||||
|
@ -316,6 +317,7 @@ fn res_wrap_to_wgpu(wmode: WrappingMode) -> wgpu::AddressMode {
|
|||
}
|
||||
|
||||
/// Convert [`lyra_resource::FilterMode`] to [`wgpu::FilterMode`]
|
||||
#[inline(always)]
|
||||
fn res_filter_to_wgpu(fmode: FilterMode) -> wgpu::FilterMode {
|
||||
match fmode {
|
||||
FilterMode::Nearest => wgpu::FilterMode::Nearest,
|
||||
|
|
|
@ -319,6 +319,7 @@ impl Material {
|
|||
}
|
||||
|
||||
impl From<gltf::texture::MagFilter> for FilterMode {
|
||||
#[inline(always)]
|
||||
fn from(value: gltf::texture::MagFilter) -> Self {
|
||||
match value {
|
||||
gltf::texture::MagFilter::Nearest => Self::Nearest,
|
||||
|
@ -329,6 +330,7 @@ impl From<gltf::texture::MagFilter> for FilterMode {
|
|||
|
||||
impl FilterMode {
|
||||
/// Get the MinFilter mode and the mipmap filter mode from gltf MinFilter
|
||||
#[inline(always)]
|
||||
pub fn from_min_filter(minf: MinFilter) -> FilterMode {
|
||||
match minf {
|
||||
MinFilter::Nearest => FilterMode::Nearest,
|
||||
|
@ -340,6 +342,7 @@ impl FilterMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn from_mag_filter(magf: MagFilter) -> FilterMode {
|
||||
match magf {
|
||||
MagFilter::Nearest => FilterMode::Nearest,
|
||||
|
@ -347,6 +350,7 @@ impl FilterMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn mipmap_filter(minf: MinFilter) -> Option<FilterMode> {
|
||||
match minf {
|
||||
MinFilter::Nearest => None,
|
||||
|
@ -360,6 +364,7 @@ impl FilterMode {
|
|||
}
|
||||
|
||||
impl From<gltf::texture::WrappingMode> for WrappingMode {
|
||||
#[inline(always)]
|
||||
fn from(value: gltf::texture::WrappingMode) -> Self {
|
||||
match value {
|
||||
gltf::texture::WrappingMode::ClampToEdge => Self::ClampToEdge,
|
||||
|
|
Loading…
Reference in New Issue