radv: keep track of the retained NIR shaders sha1 for LTO pipelines

Otherwise the per pipeline cache key doesn't consider shaders at all
when they are imported from libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834>
This commit is contained in:
Samuel Pitoiset
2023-02-08 16:26:50 +01:00
committed by Marge Bot
parent fbc7e8f3df
commit 532d63993f
2 changed files with 5 additions and 0 deletions

View File

@@ -3076,6 +3076,8 @@ radv_pipeline_get_nir(struct radv_graphics_pipeline *pipeline, struct radv_pipel
if (retain_shaders) {
/* Clone the NIR shader because NIR passes after this step will change it. */
pipeline->retained_shaders[s].nir = nir_shader_clone(NULL, stages[s].nir);
memcpy(pipeline->retained_shaders[s].shader_sha1, stages[s].shader_sha1,
sizeof(stages[s].shader_sha1));
}
stages[s].feedback.duration += os_time_get_nano() - stage_start;
@@ -3097,6 +3099,8 @@ radv_pipeline_load_retained_shaders(struct radv_graphics_pipeline *pipeline,
stages[s].stage = s;
stages[s].entrypoint =
nir_shader_get_entrypoint(pipeline->retained_shaders[s].nir)->function->name;
memcpy(stages[s].shader_sha1, pipeline->retained_shaders[s].shader_sha1,
sizeof(stages[s].shader_sha1));
stages[s].feedback.duration += os_time_get_nano() - stage_start;
stages[s].feedback.flags |= VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT;