azul icon indicating copy to clipboard operation
azul copied to clipboard

Error: OpenGL implementation doesn't include a shader compiler

Open mdcrapse opened this issue 5 years ago • 4 comments

Description

cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 27.40s
     Running `target\debug\gui_wood.exe`
glium has triggered an OpenGL error during initialization. Please report this error: https://github.com/tomaka/glium/issues
glium has triggered an OpenGL error during initialization. Please report this error: https://github.com/tomaka/glium/issues
[ERROR][azul::logging] An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

The error ocurred in: src\libcore\result.rs at line 999 in thread main

Error information:
called `Result::unwrap()` on an `Err` value: OpenGL implementation doesn't include a shader compiler

Backtrace:

azul::logging::set_up_panic_hooks @ logging.rs:86
core::ops::function::Fn::call<fn(core::panic::PanicInfo*),(core::panic @ function.rs:69
std::panicking @ panicking.rs:481
std::panicking @ panicking.rs:381
std::panicking @ panicking.rs:308
core::panicking @ panicking.rs:85
core::result::unwrap_failed<azul_core::gl @ macros.rs:18
core::result::Result<azul_core::gl::GlShader, azul_core::gl::GlShaderCreateError>::unwrap<azul_core::gl::GlShader,azul_core::gl @ result.rs:800
azul::app::compile_screen_shader @ app.rs:1390
core::option::Option<azul_core::gl::GlShader>::get_or_insert_with<azul_core::gl @ option.rs:816
azul::app @ app.rs:1388
azul::app @ app.rs:1399
azul::app::render_inner<gui_wood @ app.rs:1334
azul::app::App<gui_wood::MyDataModel>::run_inner<gui_wood @ app.rs:456
azul::app::App<gui_wood::MyDataModel>::run<gui_wood @ app.rs:283
gui_wood @ main.rs:16
std::rt::lang_start @ rt.rs:64
std::panicking::try @ panicking.rs:293
panic_unwind @ lib.rs:85
std::rt @ rt.rs:48
std::rt @ rt.rs:64
 @ exe_common.inl:288

error: process didn't exit successfully: `target\debug\gui_wood.exe` (exit code: 101)

Version / OS

  • azul version: azul = { git = "https://github.com/maps4print/azul", rev = "bb5ab4c" }

  • Operating system: Windows 10

Steps to Reproduce

Include azul in the Cargo.toml then run: cargo run.

Additional Information

rust code:

extern crate azul;

use azul::prelude::*;

struct MyDataModel { }

impl Layout for MyDataModel {
    fn layout(&self, _: LayoutInfo<Self>) -> Dom<Self> {
        Dom::div()
    }
}

fn main() {
    let mut app = App::new(MyDataModel { }, AppConfig::default()).unwrap();
    let window = app.create_window(WindowCreateOptions::default(), css::native()).unwrap();
    app.run(window).unwrap();
}

The produced executable works with my other computer.

OpenGL Viewer 5.3.4 reports OpenGL version 3.1 on my computer.

mdcrapse avatar Sep 13 '19 16:09 mdcrapse

Well, technically, this should only panic if your OpenGL driver really doesn't include a shader compiler (obviously, if it can't compile shaders, then there's no way currently to draw to the screen, hence the panic). Could you debug what GlShader::new in azul/core/gl.rs is returning? Simply clone the repo and put it as azul = { path = "../azul" } in your Cargo.toml and add some debug printing here:

https://github.com/maps4print/azul/blob/5401cdfb9d4ffc1188383298e3f16c77da6ea953/azul-core/gl.rs#L579-L585

These lines check whether the OpenGL implementation actually has a shader compiler, however (as usual in the world of OpenGL drivers), it's very likely that your driver doesn't implement this function or returns "false" as a default value. Technically, glGet(GL_SHADER_COMPILER) is part of the OpenGL spec but I've yet to see a graphics driver that adheres to the spec. It would be nice to know what driver / version / hardware configuration you have so this can be fixed upstream.

fschutt avatar Sep 13 '19 20:09 fschutt

I modified the code to the following:

// Check whether the OpenGL implementation supports a shader compiler...
let mut shader_compiler_supported = [gl::FALSE];
unsafe { gl_context.get_boolean_v(gl::SHADER_COMPILER, &mut shader_compiler_supported) };
println!("----------shader_compiler_supported: {:?} ----------", shader_compiler_supported);
if shader_compiler_supported[0] == gl::FALSE {
    // Implementation only supports binary shaders
    println!("----------no shader compiler support----------");
    return Err(GlShaderCreateError::NoShaderCompiler);
}
println!("----------shader compiler support!----------");

Then I got the following output:

     Running `target\debug\gui_wood.exe`
glium has triggered an OpenGL error during initialization. Please report this error: https://github.com/tomaka/glium/issues
glium has triggered an OpenGL error during initialization. Please report this error: https://github.com/tomaka/glium/issues
----------shader_compiler_supported: [0] ----------
----------no shader compiler support----------
[ERROR][azul::logging] An unexpected panic ocurred, the program has to exit.
Please report this error and attach the log file found in the directory of the executable.

...

My processor: Intel® Pentium® Processor B960

Sorry if I missed anything. I'm still new to graphical stuff.

mdcrapse avatar Sep 14 '19 17:09 mdcrapse

If this is a hardware limitation, then you can go ahead and close this issue.

mdcrapse avatar Dec 03 '19 19:12 mdcrapse

Well, I'll keep it open for now, but it will likely only be fixed once a llvmpipe-based software renderer is integrated (i.e. that it switches to software-OpenGL automatically on older GPUs).

fschutt avatar Dec 07 '19 09:12 fschutt