mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
fix(dx12): map composite alpha mode (#7117)
* fix(dx12): map composite alpha mode closes #7108 * changelog entry * add composite modes based on surface target * fix missing `in` in change log entry
This commit is contained in:
@@ -106,6 +106,7 @@ By @brodycj in [#6924](https://github.com/gfx-rs/wgpu/pull/6924).
|
||||
|
||||
- Fix HLSL storage format generation. By @Vecvec in [#6993](https://github.com/gfx-rs/wgpu/pull/6993) and [#7104](https://github.com/gfx-rs/wgpu/pull/7104)
|
||||
- Fix 3D storage texture bindings. By @SparkyPotato in [#7071](https://github.com/gfx-rs/wgpu/pull/7071)
|
||||
- Fix DX12 composite alpha modes. By @amrbashir in [#7117](https://github.com/gfx-rs/wgpu/pull/7117)
|
||||
|
||||
#### WebGPU
|
||||
|
||||
|
||||
@@ -281,6 +281,13 @@ pub fn map_vertex_format(format: wgt::VertexFormat) -> Dxgi::Common::DXGI_FORMAT
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_acomposite_alpha_mode(_mode: wgt::CompositeAlphaMode) -> Dxgi::Common::DXGI_ALPHA_MODE {
|
||||
Dxgi::Common::DXGI_ALPHA_MODE_IGNORE
|
||||
pub fn map_acomposite_alpha_mode(mode: wgt::CompositeAlphaMode) -> Dxgi::Common::DXGI_ALPHA_MODE {
|
||||
match mode {
|
||||
wgt::CompositeAlphaMode::PreMultiplied => Dxgi::Common::DXGI_ALPHA_MODE_PREMULTIPLIED,
|
||||
wgt::CompositeAlphaMode::PostMultiplied => Dxgi::Common::DXGI_ALPHA_MODE_STRAIGHT,
|
||||
wgt::CompositeAlphaMode::Opaque => Dxgi::Common::DXGI_ALPHA_MODE_IGNORE,
|
||||
wgt::CompositeAlphaMode::Auto | wgt::CompositeAlphaMode::Inherit => {
|
||||
Dxgi::Common::DXGI_ALPHA_MODE_UNSPECIFIED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +863,18 @@ impl crate::Adapter for super::Adapter {
|
||||
| wgt::TextureUses::COPY_SRC
|
||||
| wgt::TextureUses::COPY_DST,
|
||||
present_modes,
|
||||
composite_alpha_modes: vec![wgt::CompositeAlphaMode::Opaque],
|
||||
composite_alpha_modes: match surface.target {
|
||||
SurfaceTarget::WndHandle(_) => vec![wgt::CompositeAlphaMode::Opaque],
|
||||
SurfaceTarget::Visual(_)
|
||||
| SurfaceTarget::SurfaceHandle(_)
|
||||
| SurfaceTarget::SwapChainPanel(_) => vec![
|
||||
wgt::CompositeAlphaMode::Auto,
|
||||
wgt::CompositeAlphaMode::Inherit,
|
||||
wgt::CompositeAlphaMode::Opaque,
|
||||
wgt::CompositeAlphaMode::PostMultiplied,
|
||||
wgt::CompositeAlphaMode::PreMultiplied,
|
||||
],
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user