-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add dcomp on windows #7550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Add dcomp on windows #7550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looking good, some comments.
will get to this in the next day or two |
…-hunter/wgpu into dev/windows-os-transparent
@cwfitzgerald would you be able to re review when you get time thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, looks good in general with a few small comments. I also think that the hardcoded list of blending modes needs to be adjusted based on if DXGI or DComp is selected
} | ||
|
||
impl DCompState { | ||
pub fn get_or_init( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should also be unsafe
let dcomp_device = { | ||
profiling::scope!("DirectComposition::DCompositionCreateDevice"); | ||
unsafe { | ||
DirectComposition::DCompositionCreateDevice::< | ||
_, | ||
DirectComposition::IDCompositionDevice, | ||
>(&dxgi_device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let dcomp_device = { | |
profiling::scope!("DirectComposition::DCompositionCreateDevice"); | |
unsafe { | |
DirectComposition::DCompositionCreateDevice::< | |
_, | |
DirectComposition::IDCompositionDevice, | |
>(&dxgi_device) | |
let dcomp_device: DirectComposition::IDCompositionDevice = { | |
profiling::scope!("DirectComposition::DCompositionCreateDevice"); | |
unsafe { | |
DirectComposition::DCompositionCreateDevice(&dxgi_device) |
This feels cleaner
Might totally be unfounded and not apply here but DirectComposition on Windows has issues with NVIDIA GPU when used with multiple monitors with different and high(60+) refresh rates. This was seen on Firefox so might be specific to it. |
I definitely wouldn't worry about it here. That issue seems to be Windows 10 specific too. |
Oh! Thank you for doing this, transparency support in wgpu has been a pretty big pain point for me in the past |
Im just traveling abroad atm should be able to get to this in the next week or so |
Connections
#3486
#7108
#5150
Description
This adds dcomp support to the dx12 backend.
My main goal for this was to get window transparency to work on windows
Testing
Tested using a basic wgpu app with transparency
Squash or Rebase?
Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.I dont know if its normal or not but when running
cargo xtask test
i had 201 tests fail withcode 0xc0000005: Invalid access to memory location. (os error 998)
this is run on windows 10