glsl: relax rule on varying matching for shaders older than 4.20
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 14 Jul 2021 07:29:46 +0000 (17:29 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Jul 2021 03:06:26 +0000 (03:06 +0000)
commit0e0633ca49425dbc869521cede6a82d2d91c8042
tree8c9a864fe3f7a487ba25d1d905daf0a394bcff98
parent1e5a470b43fd1d72c3841a8759a4db38f366358a
glsl: relax rule on varying matching for shaders older than 4.20

This expands on commit c54c42321ea5. See the code comment for full
justifications. At the time of the previous commit Ian wanted to
limit the relaxing of the rule to GLSL 3.30 as that was the highest
version of shaders seen in the wild that were having trouble with
the stricter rules.

However since then I've found that the long standing issue with tess
shaders failing to compile in the game 'Layers Of Fear' is due to
this same issue. The game uses 4.10 shaders and also makes use of
explicit varying locations, so here we relax the rule to 4.20 and
make sure to apply the restriction to shaders using varyings with
explicit locations also.

Fixes: c54c42321ea5 ("glsl: relax rule on varying matching for shaders older than 4.00")

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11873>
src/compiler/glsl/link_varyings.cpp