mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
move bind type
This commit is contained in:
parent
d08b243317
commit
cfaee577e7
2 changed files with 28 additions and 28 deletions
|
@ -690,29 +690,3 @@ impl Renderer for WgpuRenderer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&BindType> for wgpu::BindingType {
|
||||
fn from(bind_type: &BindType) -> Self {
|
||||
match bind_type {
|
||||
BindType::Uniform {
|
||||
dynamic,
|
||||
properties: _,
|
||||
} => wgpu::BindingType::UniformBuffer { dynamic: *dynamic },
|
||||
BindType::Buffer { dynamic, readonly } => wgpu::BindingType::StorageBuffer {
|
||||
dynamic: *dynamic,
|
||||
readonly: *readonly,
|
||||
},
|
||||
BindType::SampledTexture {
|
||||
dimension,
|
||||
multisampled,
|
||||
} => wgpu::BindingType::SampledTexture {
|
||||
dimension: (*dimension).into(),
|
||||
multisampled: *multisampled,
|
||||
},
|
||||
BindType::Sampler => wgpu::BindingType::Sampler,
|
||||
BindType::StorageTexture { dimension } => wgpu::BindingType::StorageTexture {
|
||||
dimension: (*dimension).into(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::{
|
|||
render::{
|
||||
pass::{LoadOp, StoreOp},
|
||||
pipeline::{
|
||||
InputStepMode, VertexAttributeDescriptor, VertexBufferDescriptor, VertexFormat,
|
||||
InputStepMode, VertexAttributeDescriptor, VertexBufferDescriptor, VertexFormat, BindType
|
||||
},
|
||||
render_resource::BufferUsage,
|
||||
},
|
||||
|
@ -131,3 +131,29 @@ impl From<StoreOp> for wgpu::StoreOp {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&BindType> for wgpu::BindingType {
|
||||
fn from(bind_type: &BindType) -> Self {
|
||||
match bind_type {
|
||||
BindType::Uniform {
|
||||
dynamic,
|
||||
properties: _,
|
||||
} => wgpu::BindingType::UniformBuffer { dynamic: *dynamic },
|
||||
BindType::Buffer { dynamic, readonly } => wgpu::BindingType::StorageBuffer {
|
||||
dynamic: *dynamic,
|
||||
readonly: *readonly,
|
||||
},
|
||||
BindType::SampledTexture {
|
||||
dimension,
|
||||
multisampled,
|
||||
} => wgpu::BindingType::SampledTexture {
|
||||
dimension: (*dimension).into(),
|
||||
multisampled: *multisampled,
|
||||
},
|
||||
BindType::Sampler => wgpu::BindingType::Sampler,
|
||||
BindType::StorageTexture { dimension } => wgpu::BindingType::StorageTexture {
|
||||
dimension: (*dimension).into(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue