main, glsl: Add UniformDataDefaults which stores uniform defaults
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 30 Oct 2017 18:16:48 +0000 (11:16 -0700)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 8 Dec 2017 05:44:35 +0000 (16:44 +1100)
commit7cf1037d5af015912e84cd52a992be80f4f6092c
treedc79550f7215fd2840aa791bdd90a2e4c71d727e
parentebd9e789c40190862b28bbde8852c0b8b09df5ba
main, glsl: Add UniformDataDefaults which stores uniform defaults

The ARB_get_program_binary extension requires that uniform values in a
program be restored to their initial value just after linking.

This patch saves off the initial values just after linking. When the
program is restored by glProgramBinary, we can use this to copy the
initial value of uniforms into UniformDataSlots.

V2 (Timothy Arceri):
 - Store UniformDataDefaults only when serializing GLSL as this
   is what we want for both disk cache and ARB_get_program_binary.
   This saves us having to come back later and reset the Uniforms
   on program binary restores.

Signed-off-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl/link_uniforms.cpp
src/compiler/glsl/serialize.cpp
src/mesa/main/mtypes.h