diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 67627f3e6..96c701e25 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1557,18 +1557,7 @@ impl Global { .map_pass_err(scope)?; } ArcRenderCommand::SetBlendConstant(ref color) => { - api_log!("RenderPass::set_blend_constant"); - - state.blend_constant = OptionalState::Set; - let array = [ - color.r as f32, - color.g as f32, - color.b as f32, - color.a as f32, - ]; - unsafe { - state.raw_encoder.set_blend_constants(&array); - } + set_blend_constant(&mut state, color); } ArcRenderCommand::SetStencilReference(value) => { api_log!("RenderPass::set_stencil_reference {value}"); @@ -2565,6 +2554,21 @@ fn set_vertex_buffer( Ok(()) } +fn set_blend_constant(state: &mut State, color: &Color) { + api_log!("RenderPass::set_blend_constant"); + + state.blend_constant = OptionalState::Set; + let array = [ + color.r as f32, + color.g as f32, + color.b as f32, + color.a as f32, + ]; + unsafe { + state.raw_encoder.set_blend_constants(&array); + } +} + impl Global { pub fn render_pass_set_bind_group( &self,