radv: pass radv_graphics_state_key to radv_hash_shaders()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27073>
This commit is contained in:
Samuel Pitoiset
2024-01-15 14:38:57 +01:00
committed by Marge Bot
parent b18bfed2c5
commit 72d2eb39fb
3 changed files with 6 additions and 6 deletions

View File

@@ -47,14 +47,15 @@ radv_is_cache_disabled(struct radv_device *device)
void
radv_hash_shaders(const struct radv_device *device, unsigned char *hash, const struct radv_shader_stage *stages,
uint32_t stage_count, const struct radv_pipeline_layout *layout, const struct radv_pipeline_key *key)
uint32_t stage_count, const struct radv_pipeline_layout *layout,
const struct radv_graphics_state_key *gfx_state)
{
struct mesa_sha1 ctx;
_mesa_sha1_init(&ctx);
_mesa_sha1_update(&ctx, device->cache_hash, sizeof(device->cache_hash));
if (key)
_mesa_sha1_update(&ctx, key, sizeof(*key));
if (gfx_state)
_mesa_sha1_update(&ctx, gfx_state, sizeof(*gfx_state));
if (layout)
_mesa_sha1_update(&ctx, layout->sha1, sizeof(layout->sha1));

View File

@@ -2645,7 +2645,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, const Vk
radv_pipeline_load_retained_shaders(device, pipeline, pCreateInfo, stages);
if (radv_should_compute_pipeline_hash(device, pipeline, fast_linking_enabled)) {
radv_hash_shaders(device, hash, stages, MESA_VULKAN_SHADER_STAGES, pipeline_layout, pipeline_key);
radv_hash_shaders(device, hash, stages, MESA_VULKAN_SHADER_STAGES, pipeline_layout, &pipeline_key->gfx_state);
pipeline->base.pipeline_hash = *(uint64_t *)hash;
}

View File

@@ -2006,7 +2006,6 @@ struct radv_event {
uint64_t *map;
};
struct radv_pipeline_key;
struct radv_ray_tracing_group;
void radv_pipeline_stage_init(const VkPipelineShaderStageCreateInfo *sinfo, const struct radv_pipeline_layout *layout,
@@ -2014,7 +2013,7 @@ void radv_pipeline_stage_init(const VkPipelineShaderStageCreateInfo *sinfo, cons
void radv_hash_shaders(const struct radv_device *device, unsigned char *hash, const struct radv_shader_stage *stages,
uint32_t stage_count, const struct radv_pipeline_layout *layout,
const struct radv_pipeline_key *key);
const struct radv_graphics_state_key *gfx_state);
struct radv_ray_tracing_stage;
void radv_hash_rt_shaders(const struct radv_device *device, unsigned char *hash,