extract set_stencil_reference from render_pass_end_impl

This commit is contained in:
teoxoy 2024-06-25 16:04:40 +02:00 committed by Teodor Tanasoaia
parent 49800c30de
commit 5c941bf1f0

View File

@ -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<A: HalApi>(state: &mut State<A>, color: &Color) {
}
}
fn set_stencil_reference<A: HalApi>(state: &mut State<A>, 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,