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:
parent
3ee4890b94
commit
e99bd00dec
|
|
@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue