Skip to content

Commit

Permalink
GLES Wayland: properly resize on configure (#2094)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorvde authored and kvark committed Dec 12, 2021
1 parent 873e83c commit f875e32
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,6 @@ impl crate::Surface<super::Api> for Surface {
library.get(b"wl_egl_window_create").unwrap();
let window = wl_egl_window_create(handle.surface, 640, 480) as *mut _
as *mut std::ffi::c_void;
let wl_egl_window_resize: libloading::Symbol<WlEglWindowResizeFun> =
library.get(b"wl_egl_window_resize").unwrap();
wl_egl_window_resize(
window,
config.extent.width as i32,
config.extent.height as i32,
0,
0,
);
wl_window = Some(window);
window
}
Expand Down Expand Up @@ -1017,6 +1008,19 @@ impl crate::Surface<super::Api> for Surface {
}
};

if let Some(window) = wl_window {
let library = self.wsi.library.as_ref().unwrap();
let wl_egl_window_resize: libloading::Symbol<WlEglWindowResizeFun> =
library.get(b"wl_egl_window_resize").unwrap();
wl_egl_window_resize(
window,
config.extent.width as i32,
config.extent.height as i32,
0,
0,
);
}

let format_desc = device.shared.describe_texture_format(config.format);
let gl = &device.shared.context.lock();
let renderbuffer = gl.create_renderbuffer().unwrap();
Expand Down

0 comments on commit f875e32

Please sign in to comment.