radv: rework and add a helper for hashing a compute pipeline

It should be similar to the previous hashing method but it allows us
to get a hash directly from a pCreateInfo for future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28651>
This commit is contained in:
Samuel Pitoiset
2024-04-09 14:51:56 +02:00
committed by Marge Bot
parent 05cd85afc6
commit 9840607f4b
3 changed files with 43 additions and 11 deletions

View File

@@ -1204,3 +1204,15 @@ radv_pipeline_hash(const struct radv_device *device, const struct radv_pipeline_
if (pipeline_layout)
_mesa_sha1_update(ctx, pipeline_layout->sha1, sizeof(pipeline_layout->sha1));
}
void
radv_pipeline_hash_shader_stage(const VkPipelineShaderStageCreateInfo *sinfo,
const struct radv_shader_stage_key *stage_key, struct mesa_sha1 *ctx)
{
unsigned char shader_sha1[SHA1_DIGEST_LENGTH];
vk_pipeline_hash_shader_stage(sinfo, NULL, shader_sha1);
_mesa_sha1_update(ctx, shader_sha1, sizeof(shader_sha1));
_mesa_sha1_update(ctx, stage_key, sizeof(*stage_key));
}