Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glow doesn't work on web on Chromium #1087

Closed
yusdacra opened this issue Jan 9, 2022 · 5 comments · Fixed by #1092
Closed

glow doesn't work on web on Chromium #1087

yusdacra opened this issue Jan 9, 2022 · 5 comments · Fixed by #1092
Labels
bug Something is broken web Related to running Egui on the web

Comments

@yusdacra
Copy link
Contributor

yusdacra commented Jan 9, 2022

Describe the bug

eframe stopped working on web since the egui_glow backend switch.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/harmony-development/Loqui
  2. Get https://trunkrs.dev/
  3. Run trunk serve in root of repo
  4. Go to 0.0.0.0:8080 in browser and see the errors in console

Expected behavior

It should run fine.

Screenshots

Desktop (please complete the following information):

  • OS: NixOS (Linux 5.15.10)
  • Browser: Chromium 96.0.4664.110 (Official Build) (64-bit)

Additional context

eframe source from Cargo.lock:

[[package]]
name = "eframe"
version = "0.16.0"
source = "git+https://github.com/emilk/egui.git?branch=master#611eaa52e8f669d8972588473413d413507bea32"
Console log
WebGL: INVALID_ENUM: getParameter: invalid parameter name, WEBGL_debug_renderer_info not enabled
(anonymous) @ index-1c2f9c7ca7558b49.js:831
index-1c2f9c7ca7558b49.js:1635 WebGL2 not available - falling back to WebGL2
index-1c2f9c7ca7558b49.js:1635 egui_glow: detected WebGL prefix at 6:1.0 (OpenGL ES 2.0 Chromium)
index-1c2f9c7ca7558b49.js:1635 egui_glow: Shader version: Es100 ("WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)")
index-1c2f9c7ca7558b49.js:1635 egui_glow: Shader header: "#version 100\n"
index-1c2f9c7ca7558b49.js:701 panicked at 'assertion failed: `(left == right)`
  left: `1280`,
 right: `0`: OpenGL error occurred!', /home/patriot/.cargo/git/checkouts/egui-5e4507fa4153be06/611eaa5/egui_glow/src/painter.rs:204:13

Stack:

Error
    at imports.wbg.__wbg_new_693216e109162396 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49.js:707:19)
    at console_error_panic_hook::Error::new::h13ac39e04fdc84c6 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[53906]:0xda50d6)
    at console_error_panic_hook::hook_impl::h402524c335a55d40 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[7466]:0x831380)
    at console_error_panic_hook::hook::h1c52481292191a7f (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[60523]:0xdbb4c7)
    at core::ops::function::Fn::call::h4f82ec833d3421a7 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[40307]:0xd2c70e)
    at std::panicking::rust_panic_with_hook::h606d7c7f7a423b98 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[14346]:0xa2470c)
    at std::panicking::begin_panic_handler::{{closure}}::h9b985a293aac4ce1 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[22786]:0xb96e22)
    at std::sys_common::backtrace::__rust_end_short_backtrace::ha03abef02a8b70fd (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[53197]:0xda1bef)
    at rust_begin_unwind (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[41324]:0xd3ba76)
    at core::panicking::panic_fmt::h6314b5c91abe7349 (http://0.0.0.0:8080/index-1c2f9c7ca7558b49_bg.wasm:wasm-function[43808]:0xd5beea)


imports.wbg.__wbg_error_09919627ac0992f5 @ index-1c2f9c7ca7558b49.js:701
index-1c2f9c7ca7558b49_bg.wasm:0xdc104f Uncaught (in promise) RuntimeError: unreachable
    at __rust_start_panic (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at rust_panic (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at std::panicking::rust_panic_with_hook::h606d7c7f7a423b98 (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at std::panicking::begin_panic_handler::{{closure}}::h9b985a293aac4ce1 (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at std::sys_common::backtrace::__rust_end_short_backtrace::ha03abef02a8b70fd (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at rust_begin_unwind (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at core::panicking::panic_fmt::h6314b5c91abe7349 (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at core::panicking::assert_failed_inner::h35b0f7f5a33c494e (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at core::panicking::assert_failed::h87dfa277385a8e60 (:8080/index-1c2f9c7ca7558b49_bg.wasm)
    at egui_glow::painter::Painter::new::h16775fcfecba5b65 (:8080/index-1c2f9c7ca7558b49_bg.wasm)
@yusdacra yusdacra added the bug Something is broken label Jan 9, 2022
@emilk emilk changed the title eframe doesn't work on web anymore glow doesn't work on web on NixOS + Chromium Jan 9, 2022
@emilk
Copy link
Owner

emilk commented Jan 9, 2022

Can you try removing the code in fn is_safari_and_webkit_gtk in egui_web/src/lib.rs and see if it helps? I believe that is the INVALID_ENUM: getParameter being warned about.

It used to be protected by

if gl
        .get_extension("WEBGL_debug_renderer_info")
        .unwrap()
        .is_some()
    {

but I recently removed that (in #1020) because it caused warnings in Firefox ("WEBGL_debug_renderer_info is deprecated in Firefox and will be removed.").

@emilk emilk added the web Related to running Egui on the web label Jan 9, 2022
emilk added a commit that referenced this issue Jan 9, 2022
@yusdacra
Copy link
Contributor Author

yusdacra commented Jan 10, 2022

Commenting out the code to return false does make the application run. However it still uses WebGL1, but it used to work with WebGL2. I don't get any other warnings or errors about that; only the fallback messages by egui.

@emilk
Copy link
Owner

emilk commented Jan 10, 2022

Ok, so Chromium requires a check of WEBGL_debug_renderer_info and Firefox doesn't allow it 🙄. Just another day in web-dev. I'll re-add the check for now.

@emilk emilk changed the title glow doesn't work on web on NixOS + Chromium glow doesn't work on web on Chromium Jan 10, 2022
@emilk
Copy link
Owner

emilk commented Jan 10, 2022

Ok, I found the problem and I'm fixing it!

@yusdacra
Copy link
Contributor Author

That does indeed fix it. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken web Related to running Egui on the web
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants