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!();
|
crate::profile_function!();
|
||||||
|
|
||||||
if let Some(current_gl_context) = current_gl_context {
|
if !cfg!(target_os = "windows") {
|
||||||
crate::profile_scope!("is_current");
|
// According to https://github.com/emilk/egui/issues/4289
|
||||||
if gl_surface.is_current(current_gl_context) {
|
// we cannot do this early-out on Windows.
|
||||||
return; // Early-out to save a lot of time.
|
// 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