Errors in gl shaders on latest linux

Benjamin Sonnemann 2020-11-27 1029

Hi, i get this errors when starting chitubox x64 on linux (arch linux), since the latest qt update:

==bSupport_GL_EXT: false
           GPU vendor: X.Org
           GPU version: 4.6 (Compatibility Profile) Mesa 20.2.3
           GPU render: AMD Radeon RX 5700 XT (NAVI10, DRM 3.39.0, 5.9.10-arch1-1, LLVM 11.0.0)
           core: true
           validVersion: "46"
           hasFrameBufferObjects: true
QOpenGLShader::compile(Vertex): 0:4(7): error: identifier `gl_Position' uses reserved `gl_' prefix

*** Problematic Vertex shader source code ***
#version 460
#define lowp
#define mediump
#define highp
#line 1
in vec4 vertex;
out VS_OUT {
 vec3 vert;
 vec4 gl_Position;
} vs_out;
uniform mat4 projMatrix;
uniform mat4 mvMatrix;
uniform mat4 modelMatrix;
uniform mat3 modelNormalMatrix;
void main() {
   vs_out.vert = (modelMatrix*vertex).xyz;
   gl_Position = projMatrix * mvMatrix *modelMatrix* vertex;
}

***
=====error link: model "0:4(7): error: identifier `gl_Position' uses reserved `gl_' prefix\n"
QOpenGLShader::compile(Vertex): 0:4(7): error: identifier `gl_Position' uses reserved `gl_' prefix

*** Problematic Vertex shader source code ***
#version 460
#define lowp
#define mediump
#define highp
#line 1
in vec4 vertex;
out VS_OUT {
 vec3 vert;
 vec4 gl_Position;
} vs_out;
uniform mat4 projMatrix;
uniform mat4 mvMatrix;
uniform mat4 modelMatrix;
uniform mat3 modelNormalMatrix;
void main() {
   vs_out.vert = (modelMatrix*vertex).xyz;
   gl_Position = projMatrix * mvMatrix *modelMatrix* vertex;
}

***
=====error link2: model "0:4(7): error: identifier `gl_Position' uses reserved `gl_' prefix\n"
=====no geometryShader

The result is, that the models are not displayed correctly, you can barely see it, as it has no real surface

New Post (9)
  • 2020-11-29
    Quote 2Floor
    I don't have a solution for you but I have the same issue.  I'm also running Arch.  

    I think this may have something to do with the AMD/Vulkan drivers.  My desktop has an AMD card, and my laptop (also running Arch) has Intel graphics.  My laptop displays .stl files correctly while my desktop with AMD does not.  I've tried several versions of CHITUBOX as well.  I really think it has something to do with the graphics drivers.  Hopefully this info will help others more knowledgeable.



  • 2020-11-30
    Quote 3Floor
    Exactly the same issue. Also AMD (vega64)...
  • Benjamin Sonnemann 2020-11-30
    Quote 4Floor
    I don't have a solution for you but I have the same issue. I'm also running Arch. I think this ...
    yeah seems so, which driver do you use? do you run on testing? 
  • Benjamin Sonnemann 2020-11-30
    Quote 5Floor
    #!/usr/bin/env bash
    
    export LD_LIBRARY_PATH="/home/benjamin/amdgpu-pro/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}"
    export LIBGL_DRIVERS_PATH="/home/benjamin/amdgpu-pro/usr/lib/x86_64-linux-gnu/dri/"
    export dri_driver="amdgpu"
    
    /opt/chitubox-free/CHITUBOX

    I start chitubox now this way, after building the amdgpu-pro aur package and extracting it, and it works flawlessly :)

  • 2020-12-4
    Quote 6Floor
    This is exactly what did it for me as well.  Built amdgpu-pro aur, and no I see correctly shaded stls.
  • 2020-12-4
    Quote 7Floor
    I was able to fix it by installing amdpgu-pro-libgl. Then starting chitubox without having to change library paths.
  • Guest 2020-12-11
    Quote 8Floor
    I've got the same issue on Fedora 33 after a recent update. Don't want to build amdgpu-pro as that's a pretty poor workaround for the problem.
  • Guest 2020-12-11
    Quote 9Floor

    So I found a slightly easier workaround however it's going to make the program chug. If you start it with LIBGL_ALWAYS_SOFTWARE=1 ./CHITUBOX it works but it's slower

  • Guest 2020-12-18
    Quote 10Floor
    Guest So I found a slightly easier workaround however&nbs ...
    Another workaround is:

    AMD_DEBUG=mono ./CHITUBOX\ V1.7.0/AppRun

    I've opened a bug in mesa bugtracker:

    https://gitlab.freedesktop.org/mesa/mesa/-/issues/3926