Fragment shader not compiled: error C7538: OpenGL does not allow 'mediump' after 'inout'
Today we were trying to run fps_demo on a Windows 7 x32 bit using the CGE snapshot, however it crashes when trying to compile the shader:
Exception: Exception "EGLSLShaderCompileError":
Fragment shader not compiled:
0(10) : error C7538: OpenGL does not allow 'mediump' after 'inout'
Full log: message.txt
Looks like it's a driver issue for some Nvidia cards: https://community.khronos.org/t/opengl-does-not-allow-mediump-after-inout/67417 but I guess it needs someone smarter than me to resolve :)
The videocard in question is nVidia Geforce, 210, the latest available drivers version is installed (from 2016)
The issue seems to come from this line: https://github.com/castle-engine/castle-engine/blob/master/src/base_rendering/castleglshaders.pas#L1519 . At the beginning, I would say to try to change this line, so from:
'out mediump vec4 castle_FragColor;' + NL
->
'out vec4 castle_FragColor;' + NL
Just remove mediump -- for OpenGL it should not be necessary.
TODO for me:
- Is it maybe our bug? OpenGL is 3.3 here, not more modern 4.x. Maybe
mediumpis not allowed at that OpenGL level? This would mean we should fix it in CGE with condition like "if OpenGL is not newer than 3.3...", not a specific hack for this GPU.