Only avoid glow context switching on Windows (#4296)

…since it is reportedly broken on Windows

* Early-out added in https://github.com/emilk/egui/pull/4284
* Re-opens https://github.com/emilk/egui/issues/4173 😭 
* Closes https://github.com/emilk/egui/issues/4289
* Closes https://github.com/emilk/egui/pull/4290
This commit is contained in:
Emil Ernerfeldt 2024-04-01 12:14:44 +02:00 committed by GitHub
parent 3ee4890b94
commit e99bd00dec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 4 deletions

View File

@ -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.
}
}
}