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

Fix: Speed ​​issues on Windows when immediate viewport is on another screen #5250

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Oct 11, 2024

Fix Issues : Speed ​​issues on Windows when immediate viewport is on another screen

On Windows, we should use EventResult::RepaintNow() in Immediate Viewport to avoid FPS slowdown.

Improvement : In glow and wgpu, we are removing egui_ctx and only using integration.egui_ctx.
This simplifies the structure and reduces the possibility of bugs.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5250-patch136
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@rustbasic rustbasic closed this Oct 11, 2024
@rustbasic rustbasic reopened this Oct 11, 2024
Comment on lines -705 to -708
// Prune dead viewports:
viewports.retain(|id, _| active_viewports_ids.contains(id));
viewport_from_window.retain(|_, id| active_viewports_ids.contains(id));
painter.gc_viewports(&active_viewports_ids);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened with this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened with this code?

It is not necessary as it is handled in handle_viewport_output().

@@ -954,8 +949,6 @@ fn render_immediate_viewport(
input
};

let egui_ctx = shared.borrow().egui_ctx.clone();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this borrow() that caused performance problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement : In glow and wgpu, we are removing egui_ctx and only using integration.egui_ctx.

Fix Issues: On Windows, we should use EventResult::RepaintNow() in Immediate Viewport to avoid FPS slowdown.

@rustbasic rustbasic requested a review from emilk October 27, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed ​​issues on Windows when immediate viewport is on another screen
2 participants