From e2a18833372c1d060635dd9d73956fc22b7b674e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 26 Nov 2021 11:41:51 -0500 Subject: [PATCH] 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 Part-of: --- src/compiler/glsl/glsl_parser_extras.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index fbeea362abd..2495fbb7cf3 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -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) {