View Issue Details

IDProjectCategoryView StatusLast Update
0005538Spring engineGfx driver issuespublic2017-04-26 16:08
Reporterdmdr Assigned Toabma  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version103.0 
Summary0005538: Dubious GLSL behaviour with Mesa drivers on Linux
DescriptionI have an RX470 and am using the FOSS Mesa drivers on Arch Linux (everything has been kept up to date; Mesa version 17.0.4), and some shaders are not being compiled properly. The reported GLSL version is 1.30 but the shaders are being compiled against 1.10, resulting in some strange graphical artifacts (for example, in Zero-K I can see trees reflected in water but not on the playing field itself because of this shader: https://github.com/ZeroK-RTS/Zero-K/blob/master/ModelMaterials_103/4_features_trees.lua).

The older version of GLSL being reported is a Mesa quirk and has nothing to do with my specific card -- see here: http://stackoverflow.com/questions/43288180/why-wont-mesa-let-me-use-opengl-4-5-or-anything-but-3-0 -- but if this could be solved on the engine side that would be excellent (I'll also report this to the Mesa devs if this is likely to be a driver bug).
Additional InformationTurning on ATIHacks doesn't help (I have tried adding it to springsettings.cfg manually as well as setting it by running the spring executable directly and messing with the settings). I have not checked if the behaviour is any different with Catalyst on Linux (sorry Anarchid, I know I said I would) but those drivers are now outdated and installing them is a trip directly into dependency hell, at least on Arch. I can confirm that the shaders are working perfectly on Windows with the Crimson drivers.

I can apparently only attach one file at a time (???) so it includes infologs for my Linux and Windows installs, as well as my glxinfo -B output on Linux. ctrl-F for INFOLOG-LINUX, INFOLOG-WINDOWS or GLXINFO as desired.
TagsNo tags attached.
Attached Files
infolog-upload.txt (Attachment missing)
Checked infolog.txt for Errors

Activities

abma

2017-04-26 14:20

administrator   ~0017522

IMO the shader is broken, it must specify the version, i don't see why this should be an engine bug.

i.e.:

https://github.com/spring/spring/blob/fe754e6d36f0856de507cc592213097f8e641951/cont/base/springcontent/shaders/GLSL/SMFFragProg.glsl#L1

abma

2017-04-26 14:22

administrator   ~0017523

>>> I can apparently only attach one file at a time (???)

whats the issue with uploading them one by one?

Kloot

2017-04-26 14:33

developer   ~0017524

Last edited: 2017-04-26 14:38

[f=-000001] Custom Unit Shaders:, 0:11(16): warning: Float suffixes are invalid in GLSL 1.10

0:9(15): error: could not implicitly convert operands to arithmetic operator



When the #version directive is omitted in a shader (as with ZK's) 1.10 is assumed to be the target, which restricts the set of allowed GLSL constructs.

Note also that ATI's official drivers will accept more 'syntactic deviations' than Mesa's.

Anarchid

2017-04-26 15:55

reporter   ~0017525

Shader broken confirmed, adding the #version directive proceeds to spit out different errors.

```
[f=-000001] Warning: LuaMaterial: incorrect uniform type for "TeamColor", got: vec3 expected: vec4
[f=-000001] Warning: LuaMaterial: incorrect uniform type for "SunDir", got: unknown expected: vec3
[f=-000001] Warning: LuaMaterial: incorrect uniform type for "CameraPos", got: mat4 expected: vec3
[f=-000001] Warning: LuaMaterial: incorrect uniform type for "ShadowParams", got: mat4 expected: vec4
[f=-000001] Warning: LuaMaterial: incorrect uniform type for "ViewMatrix", got: mat3 expected: mat4
```

This is clearly a ZK bug at this point.

abma

2017-04-26 16:08

administrator   ~0017527

-> https://github.com/ZeroK-RTS/Zero-K/issues

Issue History

Date Modified Username Field Change
2017-04-26 14:09 dmdr New Issue
2017-04-26 14:09 dmdr File Added: infolog-upload.txt
2017-04-26 14:20 abma Status new => feedback
2017-04-26 14:20 abma Note Added: 0017522
2017-04-26 14:22 abma Note Added: 0017523
2017-04-26 14:33 Kloot Note Added: 0017524
2017-04-26 14:38 Kloot Note Edited: 0017524
2017-04-26 15:55 Anarchid Note Added: 0017525
2017-04-26 16:08 abma Assigned To => abma
2017-04-26 16:08 abma Status feedback => closed
2017-04-26 16:08 abma Resolution open => no change required
2017-04-26 16:08 abma Note Added: 0017527