summaryrefslogtreecommitdiff
path: root/src/compiler/glsl/serialize.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-07-03glsl/cache: save and restore ExternalSamplersUsedMarek Olšák1-0/+2
Shaders that need special code for external samplers were broken if they were loaded from the cache. Cc: 18.1 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (cherry picked from commit 99c6cae2278011309b7ca3d4735c7b341cbb4eef)
2018-06-26glsl: serialize data from glTransformFeedbackVaryingsTapani Pälli1-0/+20
While XFB has been enabled for cache, we did not serialize enough data for the whole API to work (such as glGetProgramiv). Fixes: 6d830940f7 "Allow shader cache usage with transform feedback" Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106907 Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (cherry picked from commit ab2643e4b06f63c93a57624003679903442634a8)
2018-03-20mesa: rework ParameterList to allow packingTimothy Arceri1-3/+11
Currently everything is padded to 4 components. Making the list more flexible will allow us to do uniform packing. V2 (suggestions from Nicolai): - always pass existing calls to _mesa_add_parameter() true for padd_and_align - fix bindless param value offsets - remove left over wip logic from pad and align code - zero out param value padding - whitespace fix Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-03-19glsl/serialize: Save shader program metadata sha1Jordan Justen1-0/+4
When the shader cache is used, this can be generated. In fact, the shader cache uses this sha1 to lookup the serialized GL shader program. If a GL shader program is restored with ProgramBinary, the shaders are not available, and therefore the correct sha1 cannot be generated. If this is restored, then we can use the shader cache to restore the binary programs to the program that was loaded with ProgramBinary. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2018-02-13mesa,glsl,nir: reduce gl_state_index size to 2 bytesMarek Olšák1-1/+1
Let's use the new gl_state_index16 type everywhere and remove the typecasts. This helps reduce the size of gl_program_parameter. Reviewed-by: Brian Paul <brianp@vmware.com>
2018-01-17glsl: remove unneeded extern "C" {} bracketing around Mesa includesBrian Paul1-4/+2
The two headers already have the right extern "C" annotations. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2018-01-17glsl: include util/bitscan.h in serialize.cppBrian Paul1-0/+1
Instead of relying on indirect inclusion of the header. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-08main, glsl: Add UniformDataDefaults which stores uniform defaultsJordan Justen1-2/+14
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>
2017-12-08glsl: Split out shader program serializationJordan Justen1-0/+1238
This will allow us to use the program serialization to implement ARB_get_program_binary. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>