glsl: Restore the IsES flag on the shader when reading from cache.

I found that when trying to MESA_SHADER_CAPTURE_PATH a trace, I was
getting "GLSL >= 3.00" for the ES shaders I was trying to capture.
Keeping this metadata in the cached shader program lets us capture
correctly.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4219>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4219>
This commit is contained in:
Eric Anholt 2020-03-17 12:45:46 -07:00
parent 9e3efa4294
commit 050ec8ff53
1 changed files with 2 additions and 0 deletions

View File

@ -1256,6 +1256,7 @@ serialize_glsl_program(struct blob *blob, struct gl_context *ctx,
write_hash_tables(blob, prog);
blob_write_uint32(blob, prog->data->Version);
blob_write_uint32(blob, prog->IsES);
blob_write_uint32(blob, prog->data->linked_stages);
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
@ -1314,6 +1315,7 @@ deserialize_glsl_program(struct blob_reader *blob, struct gl_context *ctx,
read_hash_tables(blob, prog);
prog->data->Version = blob_read_uint32(blob);
prog->IsES = blob_read_uint32(blob);
prog->data->linked_stages = blob_read_uint32(blob);
unsigned mask = prog->data->linked_stages;