mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
extract set_blend_constant
from render_pass_end_impl
This commit is contained in:
parent
6cb18ed072
commit
49800c30de
@ -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<A: HalApi>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_blend_constant<A: HalApi>(state: &mut State<A>, 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,
|
||||
|
Loading…
Reference in New Issue
Block a user