Skip to content

Conversation

@amrbashir
Copy link
Contributor

@amrbashir amrbashir commented Feb 12, 2025

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

closes #7108

Description
Describe what problem this is solving, and how it's solved.

Fix wgpu alpha modes when using it with windows DirectComposition.

Testing
Explain how this change is tested.

This PR was tested using the repro at https://github.com/microsoft/windows-rs/blob/91cfd289eeae05fa0bb6bdbe37a8426061f77c6e/crates/samples/windows/dcomp/src/main.rs

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@amrbashir amrbashir requested a review from a team as a code owner February 12, 2025 21:41
Comment on lines 867 to 871
wgt::CompositeAlphaMode::Auto,
wgt::CompositeAlphaMode::Inherit,
wgt::CompositeAlphaMode::Opaque,
wgt::CompositeAlphaMode::PostMultiplied,
wgt::CompositeAlphaMode::PreMultiplied,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be conditional on rendering to a DComp swapchain. Regular swapchains should only have Opaque

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) February 12, 2025 22:48
auto-merge was automatically disabled February 12, 2025 22:50

Head branch was pushed to by a user without write access

@amrbashir
Copy link
Contributor Author

apologies, had a missing in in change log entry

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) February 12, 2025 22:53
@cwfitzgerald cwfitzgerald merged commit 2f607d3 into gfx-rs:trunk Feb 12, 2025
33 checks passed
vorporeal pushed a commit to warpdotdev/wgpu that referenced this pull request Mar 3, 2025
* fix(dx12): map composite alpha mode

closes gfx-rs#7108

* changelog entry

* add composite modes based on surface target

* fix missing `in` in change log entry
vorporeal added a commit to warpdotdev/wgpu that referenced this pull request Mar 3, 2025
* fix(dx12): map composite alpha mode

closes gfx-rs#7108

* changelog entry

* add composite modes based on surface target

* fix missing `in` in change log entry

Co-authored-by: Amr Bashir <github@amrbashir.me>
davnotdev pushed a commit to davnotdev/wgpu that referenced this pull request Mar 4, 2025
* fix(dx12): map composite alpha mode

closes gfx-rs#7108

* changelog entry

* add composite modes based on surface target

* fix missing `in` in change log entry
sharmajai pushed a commit to sharmajai/wgpu that referenced this pull request Oct 12, 2025
* fix(dx12): map composite alpha mode

closes gfx-rs#7108

* changelog entry

* add composite modes based on surface target

* fix missing `in` in change log entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DX12 with DirectComposition transparency not working

2 participants