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) {