Skip to content

Commit

Permalink
Remove the one frame latency reduction at the start of the rendering
Browse files Browse the repository at this point in the history
It does not work with Windows swap chains, and might cause problems on
Wayland as well.
  • Loading branch information
fredizzimo committed Feb 14, 2024
1 parent b1a8c55 commit eb71221
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/window/update_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ impl UpdateLoop {
// (most likely due to the compositor being busy). The animated frame will
// be rendered at an appropriate time anyway.
if !skipped_frame {
// Always draw immediately for reduced latency if we have been idling
if self.num_consecutive_rendered > 0
&& window_wrapper.vsync.uses_winit_throttling()
{
// When winit throttling is used, request a redraw and wait for the render event
// Otherwise render immediately
if window_wrapper.vsync.uses_winit_throttling() {
window_wrapper
.vsync
.request_redraw(window_wrapper.skia_renderer.window());
Expand Down

0 comments on commit eb71221

Please sign in to comment.