godot: Uncaught shader compilation problem on Intel

Godot version: 4c863da4d5ad86f4c392d72dd9dbe24801884a71

OS/device including version: Arch Linux as of 2018-10-31, Intel GPU

OpenGL renderer string: Mesa DRI Intel® UHD Graphics 620 (Kabylake GT2)

full glxinfo output

Issue description:

On my Intel GPU, having a texture(foo, bar, lod) access with LOD specified will not generate a syntax error within Godot, but shader compilation will fail. Godot outputs the following. (full output)

ERROR: _display_error_with_code: ParticlesShaderGLES3: Vertex Program Compilation Failed:
0:185(13): error: no matching function for call to `texture(sampler2D, vec2, int)'; candidates are:
0:185(13): error:    vec4 texture(sampler1D, float)
0:185(13): error:    ivec4 texture(isampler1D, float)
[...] (only signatures without LOD)
0:185(13): error: type mismatch
0:187(16): warning: `m_pos' used uninitialized

   At: drivers/gles3/shader_gles3.cpp:173.
ERROR: get_current_version: Method/Function Failed, returning: __null
   At: drivers/gles3/shader_gles3.cpp:357.
ERROR: bind: Condition ' !version ' is true. returned: false
   At: drivers/gles3/shader_gles3.cpp:123.
ERROR: _get_uniform: Condition ' !version ' is true. returned: -1
   At: drivers/gles3/shader_gles3.h:380.
ERROR: _get_uniform: Condition ' !version ' is true. returned: -1
   At: drivers/gles3/shader_gles3.h:380.

Using texture(foo,bar, lod) within a fragment shader works, and using textureLod(foo,bar,lod) in the vertex shader will also work (as well as using texture(foo,bar) without the LOD).

On my other machine with Linux and a NVidia GPU (OpenGL renderer string: GeForce GTX 1080 Ti/PCIe/SSE2), this error does not occur.

I am not sure whether this is a driver or a godot bug; but if the workaround is to jave godot just replace the three-argument version of texture() with textureLod(), then that would be an appropriate fix.

Steps to reproduce:

  1. Use Linux, use an Intel GPU (Kaby Lake preferably)
  2. Create a MeshInstance, assign a ShaderMaterial to it
  3. In the vertex shader, use texture(foo,bar, lod).

Minimal reproduction project:

glslbug.zip

Just open it, godot will immediately fail to compile the shader.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Fixed by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914267 All fine with mesa 18.2.5-3 in debian unstable

It seems like the Mesa 18.2.3 update in Fedora 29 didn’t pass QA but was still pushed to stable by mistake. Judging by linked bug reports it seems pretty broken: https://bodhi.fedoraproject.org/updates/FEDORA-2018-bcdb732491

There’s an update candidate for 18.2.4 in testing, though it doesn’t say if it’s addressing the reported regressions: https://bodhi.fedoraproject.org/updates/FEDORA-2018-170fedcbc1

Tested Godot Versions: 3.1 alpha 2, 3.0.6 System: Fedora 29, Intel HD 5500, Mesa 18.2.3 full glxinfo output

The same issue happens on application start. The project manager shows a blank screen. It only occurs after upgrading from Mesa 18.2.2 to 18.2.3 full programm output

At: drivers/gles3/shader_gles3.cpp:168. ERROR: get_current_version: CanvasShaderGLES3: Fragment Program Compilation Failed: 0:89(2): error: invalid input layout qualifier used 0:90(2): error: invalid input layout qualifier used 0:91(2): error: invalid input layout qualifier used 0:92(2): error: invalid input layout qualifier used 0:94(2): error: invalid input layout qualifier used

At: drivers/gles3/shader_gles3.cpp:441. ERROR: get_current_version: Method/Function Failed, returning: __null At: drivers/gles3/shader_gles3.cpp:449. ERROR: bind: Condition ’ !version ’ is true. returned: false At: drivers/gles3/shader_gles3.cpp:123. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377. ERROR: _get_uniform: Condition ’ !version ’ is true. returned: -1 At: drivers/gles3/shader_gles3.h:377.