-
Notifications
You must be signed in to change notification settings - Fork 920
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
Winit Updated Caused Redraws Not to Happen #4627
Comments
This happens on windows too, it's something related to the winit update. |
I just looked into your examples, and you don't even ask for redraw to have a loop for rendering. The only place where you do so was in Winit is now using |
diff --git a/examples/common/src/framework.rs b/examples/common/src/framework.rs
index bced1eaa8..9a9287dd6 100644
--- a/examples/common/src/framework.rs
+++ b/examples/common/src/framework.rs
@@ -72,7 +72,7 @@ pub trait Example: 'static + Sized {
}
struct Setup {
- _window: Window,
+ window: Window,
event_loop: EventLoop<()>,
instance: wgpu::Instance,
size: winit::dpi::PhysicalSize<u32>,
@@ -244,7 +244,7 @@ async fn setup<E: Example>(title: &str) -> Setup {
.expect("Unable to find a suitable GPU adapter!");
Setup {
- _window: window,
+ window,
event_loop,
instance,
size,
@@ -259,6 +259,7 @@ async fn setup<E: Example>(title: &str) -> Setup {
fn start<E: Example>(
#[cfg(not(target_arch = "wasm32"))] Setup {
+ window,
event_loop,
instance,
size,
@@ -269,6 +270,7 @@ fn start<E: Example>(
..
}: Setup,
#[cfg(target_arch = "wasm32")] Setup {
+ window,
event_loop,
instance,
size,
@@ -375,8 +377,12 @@ fn start<E: Example>(
example.render(&view, &device, &queue);
+ window.pre_present_notify();
+
frame.present();
+ window.request_redraw();
+
#[cfg(target_arch = "wasm32")]
{
if let Some(offscreen_canvas_setup) = &offscreen_canvas_setup {
This will probably do it? You can remove |
I checked |
with the patch I posted applied? |
macOS could be broken, but you can try asking for redraw in |
@kchibisov with path |
@kchibisov nice, Thanks! I figured it was an issue with how we migrated, just hadn't gotten a chance to look at it yet. |
@swiftcoder macOS could still be broken, since we have some issue in alacritty due to drawing from within |
Same here (Arch Linux with 545 drivers and Wayland). Unfocusing and refocusing the window will cause a new frame to be drawn. Otherwise, nothing. |
@kaimast with the patch applied? |
Sorry, I thought the patch was in trunk already. I have a PRIME setup with Intel UHD graphics and a GTX 1650 TI. Using low power preference everything works fine with the patch applied. When selecting the Nvidia GPU it will draw one frame and then become unresponsive (seems like a different bug). |
Our event loop handling is a bit of a complete mess. I'm working to refactor it to be a bit more sane, though it will probably take me a day or two, as there are a bunch of competing requirements.
|
With this change I get the following error now
|
Man, why is this so hard to get right? Could you rerun with RUST_BACKTRACE=1 |
Some more context. The crash for me only happens when running with Here is the full output:
|
Description
request_redraw might not be working, the example only renders one frame. This also affects my application which is based on the skybox example. This is probably an Nvidia driver bug because this driver version reworks many Wayland things.
Repro steps
cargo run --bin skybox
Expected vs observed behavior
Many frames should be rendered per second, but only one is observed once.
Extra materials
None
Platform
OS: Archlinux x86-64
Nvidia Driver: 545.29.02
GPU: 3080 Ti
DE: Hyprland
The text was updated successfully, but these errors were encountered: