mesa: rename gl_shader::sha1 to disk_cache_sha1
there will be more sha1s Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13869>
This commit is contained in:
@@ -2153,11 +2153,11 @@ can_skip_compile(struct gl_context *ctx, struct gl_shader *shader,
|
||||
if (ctx->Cache) {
|
||||
char buf[41];
|
||||
disk_cache_compute_key(ctx->Cache, source, strlen(source),
|
||||
shader->sha1);
|
||||
if (disk_cache_has_key(ctx->Cache, shader->sha1)) {
|
||||
shader->disk_cache_sha1);
|
||||
if (disk_cache_has_key(ctx->Cache, shader->disk_cache_sha1)) {
|
||||
/* We've seen this shader before and know it compiles */
|
||||
if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
|
||||
_mesa_sha1_format(buf, shader->sha1);
|
||||
_mesa_sha1_format(buf, shader->disk_cache_sha1);
|
||||
fprintf(stderr, "deferring compile of shader: %s\n", buf);
|
||||
}
|
||||
shader->CompileStatus = COMPILE_SKIPPED;
|
||||
@@ -2295,9 +2295,9 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
|
||||
|
||||
if (ctx->Cache && shader->CompileStatus == COMPILE_SUCCESS) {
|
||||
char sha1_buf[41];
|
||||
disk_cache_put_key(ctx->Cache, shader->sha1);
|
||||
disk_cache_put_key(ctx->Cache, shader->disk_cache_sha1);
|
||||
if (ctx->_Shader->Flags & GLSL_CACHE_INFO) {
|
||||
_mesa_sha1_format(sha1_buf, shader->sha1);
|
||||
_mesa_sha1_format(sha1_buf, shader->disk_cache_sha1);
|
||||
fprintf(stderr, "marking shader: %s\n", sha1_buf);
|
||||
}
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ shader_cache_write_program_metadata(struct gl_context *ctx,
|
||||
goto fail;
|
||||
|
||||
for (unsigned i = 0; i < prog->NumShaders; i++) {
|
||||
memcpy(cache_item_metadata.keys[i], prog->Shaders[i]->sha1,
|
||||
memcpy(cache_item_metadata.keys[i], prog->Shaders[i]->disk_cache_sha1,
|
||||
sizeof(cache_key));
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ shader_cache_read_program_metadata(struct gl_context *ctx,
|
||||
|
||||
for (unsigned i = 0; i < prog->NumShaders; i++) {
|
||||
struct gl_shader *sh = prog->Shaders[i];
|
||||
_mesa_sha1_format(sha1buf, sh->sha1);
|
||||
_mesa_sha1_format(sha1buf, sh->disk_cache_sha1);
|
||||
ralloc_asprintf_append(&buf, "%s: %s\n",
|
||||
_mesa_shader_stage_to_abbrev(sh->Stage), sha1buf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user