glsl: fix setting compiled_source_sha1 without a shader cache

We need to set it even if Cache == NULL.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13966>
This commit is contained in:
Marek Olšák 2021-11-26 11:41:51 -05:00 committed by Marge Bot
parent 2785141c16
commit e2a1883337
1 changed files with 2 additions and 1 deletions

View File

@ -2316,9 +2316,10 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
delete state->symbols;
ralloc_free(state);
if (ctx->Cache && shader->CompileStatus == COMPILE_SUCCESS) {
if (shader->CompileStatus == COMPILE_SUCCESS)
memcpy(shader->compiled_source_sha1, source_sha1, SHA1_DIGEST_LENGTH);
if (ctx->Cache && shader->CompileStatus == COMPILE_SUCCESS) {
char sha1_buf[41];
disk_cache_put_key(ctx->Cache, shader->disk_cache_sha1);
if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {