Skip to content

Commit

Permalink
[d3d12] Document map_blend_factor (#4151)
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored Sep 18, 2023
1 parent 471229a commit 8adab25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wgpu-hal/src/dx12/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ pub fn map_polygon_mode(mode: wgt::PolygonMode) -> d3d12_ty::D3D12_FILL_MODE {
}
}

/// D3D12 doesn't support passing factors ending in `_COLOR` for alpha blending
/// (see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_render_target_blend_desc).
/// Therefore this function takes an additional `is_alpha` argument
/// which if set will return an equivalent `_ALPHA` factor.
fn map_blend_factor(factor: wgt::BlendFactor, is_alpha: bool) -> d3d12_ty::D3D12_BLEND {
use wgt::BlendFactor as Bf;
match factor {
Expand Down

0 comments on commit 8adab25

Please sign in to comment.