From 277bef37c7e8ecac4288de2cdae2f14de7b9aeb9 Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Thu, 11 Oct 2018 23:56:56 -0600 Subject: [PATCH] Minor refactor --- wgpu-native/src/conv.rs | 11 ++++++----- wgpu-native/src/device.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wgpu-native/src/conv.rs b/wgpu-native/src/conv.rs index f467fbeb5..4708c7464 100644 --- a/wgpu-native/src/conv.rs +++ b/wgpu-native/src/conv.rs @@ -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) } diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index b9941a819..d2185a235 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -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