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>
serialize_glsl_program(struct blob *blob, struct gl_context *ctx,
struct gl_shader_program *prog)
{
+ blob_write_bytes(blob, prog->data->sha1, sizeof(prog->data->sha1));
+
write_uniforms(blob, prog);
write_hash_tables(blob, prog);
assert(prog->data->UniformStorage == NULL);
+ blob_copy_bytes(blob, prog->data->sha1, sizeof(prog->data->sha1));
+
read_uniforms(blob, prog);
read_hash_tables(blob, prog);