mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-02-19 18:33:30 +00:00
Minor refactor
This commit is contained in:
parent
90e04cbe75
commit
277bef37c7
@ -41,7 +41,7 @@ pub(crate) fn map_buffer_usage(
|
||||
}
|
||||
|
||||
pub(crate) fn map_binding_type(
|
||||
binding_ty: &binding_model::BindingType,
|
||||
binding_ty: binding_model::BindingType,
|
||||
) -> hal::pso::DescriptorType {
|
||||
use binding_model::BindingType::*;
|
||||
use hal::pso::DescriptorType as H;
|
||||
@ -91,12 +91,13 @@ pub(crate) fn map_blend_state_descriptor(
|
||||
desc: &pipeline::BlendStateDescriptor,
|
||||
) -> hal::pso::ColorBlendDesc {
|
||||
let color_mask = desc.write_mask;
|
||||
let blend_state = match desc.blend_enabled {
|
||||
true => hal::pso::BlendState::On {
|
||||
let blend_state = if desc.blend_enabled {
|
||||
hal::pso::BlendState::On {
|
||||
color: map_blend_descriptor(&desc.color),
|
||||
alpha: map_blend_descriptor(&desc.alpha),
|
||||
},
|
||||
false => hal::pso::BlendState::Off,
|
||||
}
|
||||
} else {
|
||||
hal::pso::BlendState::Off
|
||||
};
|
||||
hal::pso::ColorBlendDesc(map_color_write_flags(color_mask), blend_state)
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ pub extern "C" fn wgpu_device_create_bind_group_layout(
|
||||
bindings.iter().map(|binding| {
|
||||
hal::pso::DescriptorSetLayoutBinding {
|
||||
binding: binding.binding,
|
||||
ty: conv::map_binding_type(&binding.ty),
|
||||
ty: conv::map_binding_type(binding.ty),
|
||||
count: bindings.len(),
|
||||
stage_flags: conv::map_shader_stage_flags(binding.visibility),
|
||||
immutable_samplers: false, // TODO
|
||||
|
Loading…
Reference in New Issue
Block a user