glsl: force_glsl_version to shaders with no defined version
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 25 Jun 2021 10:30:32 +0000 (20:30 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 29 Jun 2021 02:59:28 +0000 (02:59 +0000)
commite607205af06ed22a4ac8e32a9b92fe0d7197aac9
tree4c0109bff73923afd117fe1d7a9a3b816dd4b8fb
parent02dd03ff3ce07362c1c1636d537f90ad96c87c49
glsl: force_glsl_version to shaders with no defined version

If a shader has no defined version force_glsl_version was
previous ignored and the shader would default to 110. This updates
the code so that those shaders are forced to a new level also.

We reused the existing code to make sure a sensible value is set
for the version.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11602>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h