Skip to content
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

egui-wgpu: reduce input latency by defaulting to double-buffering #3714

Closed
wants to merge 1 commit into from

Conversation

emilk
Copy link
Owner

@emilk emilk commented Dec 18, 2023

This makes a huge difference in perceived latency on my 60 Hz monitor on macOS on a native build.

There is no difference on web though afaict.

For me this is a much better default. Tearing is mildly annoying in some circumstances, but input latency makes an application feel sluggish all the time.

This makes a huge difference in perceived latency on my 60 Hz monitor
on macOS on a native build.

There is no difference on web though afaict.

For me this is a much better default. Tearing is mildly annoying,
but input latency makes an aplication feel sluggish.
@emilk emilk added eframe Relates to epi and eframe performance Lower CPU/GPU usage (optimize) egui-wgpu labels Dec 18, 2023
@emilk
Copy link
Owner Author

emilk commented Dec 19, 2023

Sadly this will burn a lot of cpu, since we will repaint as fast as we can (e.g. at 500Hz), ignoring the monitor refresh rate.

@Wumpf
Copy link
Collaborator

Wumpf commented Dec 19, 2023

@emilk emilk marked this pull request as draft January 3, 2024 16:00
@torokati44
Copy link
Contributor

With the PR mentioned above now merged, is this unblocked?

@emilk
Copy link
Owner Author

emilk commented Jan 23, 2024

Yes! I'll make a new PR though since this the API for this changed

@emilk emilk closed this Jan 23, 2024
emilk added a commit that referenced this pull request Jan 24, 2024
Setting `desired_maximum_frame_latency` to a low value should
theoretically lead to lower latency in winit apps using `egui-wgpu`
(e.g. in `eframe` with `wgpu` backend).

* Replaces #3714
* See also gfx-rs/wgpu#4899

----

It seems like `desired_maximum_frame_latency` has no effect on my Mac. I
lowered my monitor refresh-rate to 30Hz to test, and can see no
difference between `desired_maximum_frame_latency` of `0` or `3`.

Before when experimenting with changing the global `DESIRED_NUM_FRAMES`
in `wgpu` I saw a huge difference, so I wonder what has changed.

I verified that `set_maximum_drawable_count` is being called with either
`1` or `2`, but I perceive no difference between the two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe egui-wgpu performance Lower CPU/GPU usage (optimize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants