Skip to content

Commit 581b22e

Browse files
authored
Move warning to correct location (#3484)
It seems that where it was, it warned about the context being recreated in every case, no matter whether the context would actually be recreated or not.
1 parent bb01d72 commit 581b22e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

wgpu-hal/src/gles/egl.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -803,18 +803,19 @@ impl crate::Instance<super::Api> for Instance {
803803
}
804804
#[cfg(not(feature = "emscripten"))]
805805
(Rwh::Wayland(_), raw_window_handle::RawDisplayHandle::Wayland(display_handle)) => {
806-
/* Wayland displays are not sharable between surfaces so if the
807-
* surface we receive from this handle is from a different
808-
* display, we must re-initialize the context.
809-
*
810-
* See gfx-rs/gfx#3545
811-
*/
812-
log::warn!("Re-initializing Gles context due to Wayland window");
813806
if inner
814807
.wl_display
815808
.map(|ptr| ptr != display_handle.display)
816809
.unwrap_or(true)
817810
{
811+
/* Wayland displays are not sharable between surfaces so if the
812+
* surface we receive from this handle is from a different
813+
* display, we must re-initialize the context.
814+
*
815+
* See gfx-rs/gfx#3545
816+
*/
817+
log::warn!("Re-initializing Gles context due to Wayland window");
818+
818819
use std::ops::DerefMut;
819820
let display_attributes = [egl::ATTRIB_NONE];
820821

0 commit comments

Comments
 (0)