Skip to content

Commit

Permalink
Only avoid glow context switching on Windows (#4296)
Browse files Browse the repository at this point in the history
…since it is reportedly broken on Windows

* Early-out added in #4284
* Re-opens #4173 😭 
* Closes #4289
* Closes #4290
  • Loading branch information
emilk authored Apr 1, 2024
1 parent 3ee4890 commit e99bd00
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/eframe/src/native/glow_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,17 @@ fn change_gl_context(
) {
crate::profile_function!();

if let Some(current_gl_context) = current_gl_context {
crate::profile_scope!("is_current");
if gl_surface.is_current(current_gl_context) {
return; // Early-out to save a lot of time.
if !cfg!(target_os = "windows") {
// According to https://github.com/emilk/egui/issues/4289
// we cannot do this early-out on Windows.
// TODO(emilk): optimize context switching on Windows too.
// See https://github.com/emilk/egui/issues/4173

if let Some(current_gl_context) = current_gl_context {
crate::profile_scope!("is_current");
if gl_surface.is_current(current_gl_context) {
return; // Early-out to save a lot of time.
}
}
}

Expand Down

0 comments on commit e99bd00

Please sign in to comment.