diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 96c701e25..22adf1525 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1560,17 +1560,7 @@ impl Global { set_blend_constant(&mut state, color); } ArcRenderCommand::SetStencilReference(value) => { - api_log!("RenderPass::set_stencil_reference {value}"); - - state.stencil_reference = value; - if state - .pipeline_flags - .contains(PipelineFlags::STENCIL_REFERENCE) - { - unsafe { - state.raw_encoder.set_stencil_reference(value); - } - } + set_stencil_reference(&mut state, value); } ArcRenderCommand::SetViewport { ref rect, @@ -2569,6 +2559,20 @@ fn set_blend_constant(state: &mut State, color: &Color) { } } +fn set_stencil_reference(state: &mut State, value: u32) { + api_log!("RenderPass::set_stencil_reference {value}"); + + state.stencil_reference = value; + if state + .pipeline_flags + .contains(PipelineFlags::STENCIL_REFERENCE) + { + unsafe { + state.raw_encoder.set_stencil_reference(value); + } + } +} + impl Global { pub fn render_pass_set_bind_group( &self,