glsl: Restore the IsES flag on the shader when reading from cache.
authorEric Anholt <eric@anholt.net>
Tue, 17 Mar 2020 19:45:46 +0000 (12:45 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 23 Mar 2020 03:49:37 +0000 (20:49 -0700)
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>

src/compiler/glsl/serialize.cpp

index 23a13ea38bc99d737c9983a7d973d5489d227032..11cae46dd8b8cf186d363b3b50a9bf1e49503d15 100644 (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;