diff options
author | Jordan Justen <[email protected]> | 2018-04-19 15:39:40 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2018-07-09 23:02:32 -0700 |
commit | cce3994dee83c8a8e01983b4801e8d73d64a3b06 (patch) | |
tree | 46b936316cf1f9457ac8d6d7e3654880507a05b7 /src/mesa/main/program_binary.c | |
parent | 6497be42b7260b2279e41dcb05fcd6fc6551a061 (diff) |
mesa: Always call ProgramBinarySerializeDriverBlob
The driver may prefer to have a different blob for
ARB_get_program_binary compared to the version saved out for the disk
shader cache.
Since they both use the driver_cache_blob field, we need to always
give the driver the opportunity to fill in the driver_cache_blob when
saving the program binary.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/program_binary.c')
-rw-r--r-- | src/mesa/main/program_binary.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/main/program_binary.c b/src/mesa/main/program_binary.c index af94b79f82d..427a79dc94d 100644 --- a/src/mesa/main/program_binary.c +++ b/src/mesa/main/program_binary.c @@ -171,24 +171,22 @@ static void write_program_payload(struct gl_context *ctx, struct blob *blob, struct gl_shader_program *sh_prog) { - bool serialize[MESA_SHADER_STAGES]; for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) { struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage]; - serialize[stage] = shader && shader->Program->driver_cache_blob == NULL; - if (serialize[stage]) + if (shader) ctx->Driver.ProgramBinarySerializeDriverBlob(ctx, shader->Program); } serialize_glsl_program(blob, ctx, sh_prog); for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) { - if (!serialize[stage]) - continue; - - struct gl_program *prog = sh_prog->_LinkedShaders[stage]->Program; - ralloc_free(prog->driver_cache_blob); - prog->driver_cache_blob = NULL; - prog->driver_cache_blob_size = 0; + struct gl_linked_shader *shader = sh_prog->_LinkedShaders[stage]; + if (shader) { + struct gl_program *prog = sh_prog->_LinkedShaders[stage]->Program; + ralloc_free(prog->driver_cache_blob); + prog->driver_cache_blob = NULL; + prog->driver_cache_blob_size = 0; + } } } |