-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Transparent windows in Wayland are opaque #5779
Comments
That's unfortunate. I expect that whatever special-casing we're doing to work around this is ultimately responsible here. |
I attempted to reproduce, here is the log (adding it above!) Because
No visual window is created. |
Based on @alice-i-cecile 's comment I attempted to build the example without |
Good digging. I strongly suspect that the linked |
So I rebased gfx-rs/wgpu#2836 over the diff --git a/Cargo.toml b/Cargo.toml
index b0920d9e..52bccaeb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1555,3 +1555,6 @@ inherits = "release"
opt-level = "z"
lto = "fat"
codegen-units = 1
+
+[patch.crates-io]
+wgpu = { git = "https://github.com/Hoverbear-Consulting/wgpu", branch = "rebased-alpha_mode-for-bevy-5779" }
\ No newline at end of file
diff --git a/crates/bevy_render/src/view/window.rs b/crates/bevy_render/src/view/window.rs
index bba94068..2351a0ea 100644
--- a/crates/bevy_render/src/view/window.rs
+++ b/crates/bevy_render/src/view/window.rs
@@ -172,6 +172,7 @@ pub fn prepare_windows(
PresentMode::AutoVsync => wgpu::PresentMode::AutoVsync,
PresentMode::AutoNoVsync => wgpu::PresentMode::AutoNoVsync,
},
+ alpha_mode: wgpu::CompositeAlphaMode::PreMultiplied,
};
// Do the initial surface configuration if it hasn't been configured yet Then running the Here using I'm not entirely clear what this setting should be, but I can at least confirm that the patch improves the current situation with little effort. |
I can't reproduce this on either
This could be vendor-specific. |
fixed as said above |
Bevy version
0.7.0, 0.8.1 or 0.9.0-dev
[Optional] Relevant system information
Rust:
Adapter:
On Arch Linux, using Gnome (in Wayland mode)
What you did
From a freshly cloned repository I ran:
cargo run --example transparent_window --features x11
, yielding:cargo run --example transparent_window --features wayland
, yielding:I attempted to update
winit
using thedependabot/cargo/winit-0.27.2
branch (#5701) with this patch, but it did not solve it:Patch
I then attempted to replicate the issue in
winit
using the latest main, howeverwinit
won't draw wayland windows (note) so I couldn't replicate.The example in
winit
ran but did not produce a visual window:Next I tried
![image](https://user-images.githubusercontent.com/130903/186287168-1c09bf1f-4358-497d-bdfb-7a0e97eea35b.png)
glutin
as thewinit
docs recommended instead (note), this seemed to work ok:What went wrong
I was expecting roughly the same output between x11 and Wayland in the example. The wayland feature seems to render the example incorrect, as the window is supposed to be transparent.
Additional information
It's unclear to me what's going on and I'm fairly new to bevy, so I don't really have any idea what's going on!
@benbrittain noted gfx-rs/wgpu#687 (comment) might be relevant, if so that implies gfx-rs/wgpu#2836 may be required to fix this.
The text was updated successfully, but these errors were encountered: