emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.96k stars 1.52k forks source link

Egui fails to run with webkitgtk #1400

Open Titaniumtown opened 2 years ago

Titaniumtown commented 2 years ago

On webkitgtk (Epiphany 42) egui fails to run and simply has a grey screen. Here's egui.rs: image

I can also reproduce this issue with the latest git version of egui.

DusterTheFirst commented 2 years ago

The GL error looks to correspond to the GL_INVALID_OPERATION error.

emilk commented 2 years ago

It would be great if you could help dig a bit deeper into this!

Check out https://github.com/emilk/egui/pull/1403 and see if it helps narrow it down, and perhaps add more calls to check_for_gl_error!(&self.gl); here and there to figure out exactly which line triggers the OpenGL error.

emilk commented 2 years ago

I have a hunch that it is the "emulated VAO":s that is causing this issue. I'm investigating.

emilk commented 2 years ago

If I modify fn supports_vao to return false I always get the error GL error, at egui_glow/src/vao.rs:93 (enable_vertex_attrib_array): GL_INVALID_OPERATION (0x502). As far as I understand, this is because if VAO is supported, it HAS to be used.

I pushed new code to master that logs more details around VAO supported, including logging the supported extensions. Perhaps the supports_vao functions needs to be improved to get this working properly.

Please try out latest master @Titaniumtown and take note of everything that is logged in the web console!

Titaniumtown commented 2 years ago

https://github.com/emilk/egui/commit/ea9393aa9b7cd3b6d08aa54bc42e126bf7a1fcdd Seems to fix most issues for me. but I just got this error, but the application still runs file ignoring that it seems: image

GL error, at /home/simon/.cargo/git/checkouts/egui-d26441160a39d319/ea9393a/egui_glow/src/painter.rs:569 (tex_sub_image_2d): GL_INVALID_ENUM (0x500). Please file a bug at https://github.com/emilk/egui/issues

Titaniumtown commented 2 years ago

Other information logged in the console: image

Supported OpenGL extensions: {"EXT_texture_filter_anisotropic", "WEBGL_compressed_texture_s3tc", "OES_vertex_array_object", "WEBGL_draw_buffers", "EXT_sRGB", "WEBGL_lose_context", "ANGLE_instanced_arrays", "OES_texture_float_linear", "EXT_shader_texture_lod", "WEBGL_debug_renderer_info", "OES_standard_derivatives", "WEBGL_compressed_texture_astc", "OES_texture_float", "OES_element_index_uint", "OES_texture_half_float_linear", "EXT_texture_compression_rgtc", "OES_texture_half_float", "KHR_parallel_shader_compile"}

emilk commented 2 years ago

The tex_sub_image_2d/GL_INVALID_ENUM warning is surprising. Your WebGL1 backend does support the EXT_sRGB extension, so it shouldn't be whining about it.

tex_sub_image_2d is responsible for updating the font atlas with new characters. What happens if you paste in ÅÄÖ into an egui text field - do the letters show up?

Titaniumtown commented 2 years ago

ÅÄÖ does not show up when pasted into a egui text field.

Titaniumtown commented 2 years ago

Also, noticed this weird shadow on webkitgtk: image

On Firefox: image

emilk commented 2 years ago

I think you'll have to dig down why tex_sub_image_2d fails on your browser when it says it supports EXT_sRGB.

It is also strange that your webkitgtk doesn't support WebGL2. Are you using a very old webkitgtk?

Titaniumtown commented 2 years ago

I think you'll have to dig down why tex_sub_image_2d fails on your browser when it says it supports EXT_sRGB.

It is also strange that your webkitgtk doesn't support WebGL2. Are you using a very old webkitgtk?

I'm using the latest Epiphany (42.0) which is Webkitgtk 2.36.0

emilk commented 2 years ago

Does Epiphany/Webkitgtk not support WebGL2? What says https://webglreport.com/?v=2?

Titaniumtown commented 2 years ago

It seems it doesn't.... image

There's this issue on epiphany's gitlab: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1618

But it was closed as it wasn't a epiphany issue. But I can't find any information about webgl2 on webkitgtk.

emilk commented 3 months ago

Is this still a problem on egui.rs?