Skip to content

fix(gui): explicitly set GLSL profile in shaders#227

Merged
craftablescience merged 1 commit intocraftablescience:mainfrom
Exotic0015:main
Mar 16, 2025
Merged

fix(gui): explicitly set GLSL profile in shaders#227
craftablescience merged 1 commit intocraftablescience:mainfrom
Exotic0015:main

Conversation

@Exotic0015
Copy link
Contributor

For some reason, current Nvidia drivers on Linux don't set a default OpenGL profile:

OpenGL version string: 4.6.0 NVIDIA 570.124.04
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

While other vendors do, an example from an AMD gpu:

OpenGL version string: 4.6 (Compatibility Profile) Mesa 25.0.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

This causes shaders used in model previews to fail compilation, making them not render with the logs containing the following lines, among others:

QOpenGLShader::compile(Vertex): 0(2) : error C0201: unsupported version 150
QOpenGLShader::compile(Fragment): 0(2) : error C0201: unsupported version 150

This PR works around this issue specifying the used GLSL profile in the shader sources. This is fully spec compliant, as can be seen here.

@craftablescience craftablescience added the bug Something isn't working label Mar 16, 2025
@craftablescience craftablescience added this to the 4.4 milestone Mar 16, 2025
@craftablescience
Copy link
Owner

craftablescience commented Mar 16, 2025

awesome, thanks! I don't have an nvidia gpu on any of my machines, so didn't even know this was a bug

@craftablescience craftablescience merged commit 0275645 into craftablescience:main Mar 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants