cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.28k stars 939 forks source link

GLSL Shader Issue with Intel GPU on Linux #2301

Closed DaAwesomeP closed 1 year ago

DaAwesomeP commented 1 year ago

Hello,

I am using the latest Cinder (bfd055817bc6f04b4ff6a410932618c7eef0d78c) on Debian 11 compiled with CMake. This machine has an Intel integrated GPU. The app runs fine on another Debian 11 machine with a Nvidia GPU, but when I run it on this machine:

terminate called after throwing an instance of 'cinder::gl::GlslProgLinkExc'
  what():  error: vertex shader output `vColor' specifies smooth interpolation qualifier, but fragment shader input specifies no interpolation qualifier

Aborted

Output of glxinfo | grep OpenGL:

OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CML GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.3.5
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.3.5
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

Does Cinder simply require a Nvidia GPU with the official Nvidia driver on Linux?

gaborpapp commented 1 year ago

Probably the intel shader compiler is more picky than the nvidia one. You should modify your shaders to respect this. The error message is not connected to Cinder.

Something like this maybe?

// vertex shader smooth out vec4 vColor;

// fragment shader smooth in vec4 vColor;

DaAwesomeP commented 1 year ago

Ah, there was a mismatch between two files. Sorry about that and thank you for your help!