-2

I am trying to use this library https://github.com/ArjunNair/egui_sdl2_gl in my rust project. Before I tried to implement it, my program worked as expected (just a black window). Now I am getting a runtime error from my OpenGL-context and I can't think of why:

    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
         Running `target/debug/ivy`
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Could not create GL context: GLXBadProfileARB"', src/engine/engine.rs:52:53
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
       1: core::panicking::panic_fmt
                 at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
       2: core::result::unwrap_failed
                 at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1749:5
       3: core::result::Result<T,E>::unwrap
                 at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1065:23
       4: ivy::engine::engine::IvyWindow::new
                 at ./src/engine/engine.rs:52:26
       5: ivy::main
                 at ./src/main.rs:9:19
       6: core::ops::function::FnOnce::call_once
                 at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I have done some research but I couldn't find anything that helped me. Probably because I don't know what to look for.

Also, I am pretty new to rust and my code is probably overall pretty unoptimized and unsafe but thats fine for now (I guess). You can find my project here:

https://gitlab.n-j.me/janke/ivy/-/tree/dev

The latest version is on the "dev"-branch.

genpfault
  • 51,148
  • 11
  • 85
  • 139

1 Answers1

1

In general, the GLXBadProfileARB is generated if the value of GLX_CONTEXT_PROFILE_MASK_ARB contains more than a single valid profile bit.

But it looks like you are facing known bug in Mesa library: https://chromium.googlesource.com/external/github.com/glfw/glfw/+/refs/heads/ci/src/glx_context.c#587

Maybe it would be a good idea to apply similar workaround in rust or to update Mesa?