glsl: define gl_LightSource members in ARB_vertex_program order
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 26 Jun 2020 08:54:56 +0000 (18:54 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 30 Jun 2020 01:29:43 +0000 (01:29 +0000)
commit4cca5137aed20c93bfcb57324d094f585984c0c9
tree2fe78c82eafc15111d949fd2e588568772592633
parent5ddab654d93f6f23f3b0f0fa79b086810b3f5c58
glsl: define gl_LightSource members in ARB_vertex_program order

GLSL shares functionality with ARB_vertex_program but the GLSL
spec defines the gl_LightSource builtin with a member order that
is different from the packing expected in ARB_vertex_program.
This difference introduces a need for specialist lowering code
when handling builtin structs that is not required for normal
uniform structs due to member location mismatches.

Since gl_LightSource can't be redefined it shouldn't matter if
we add the members in the order listed in the spec, just so long
as we add them all. So here we rearrange the definition of the
glsl builtin to reflex our internal layout and that of
ARB_vertex_program. This required for the following patch.

CC: <stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
src/compiler/glsl/builtin_types.cpp
src/compiler/glsl/builtin_variables.cpp