From f70fb753b996e5bbe4aa40f93b015829e0cd74d2 Mon Sep 17 00:00:00 2001 From: jazzfool Date: Wed, 2 Aug 2023 01:24:36 +1000 Subject: [PATCH] zink: Hash only first 32 bits of zink_gfx_pipeline_state with full DS3 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8245 Part-of: --- src/gallium/drivers/zink/zink_program_state.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_program_state.hpp b/src/gallium/drivers/zink/zink_program_state.hpp index 3cb2f4b..c74362a 100644 --- a/src/gallium/drivers/zink/zink_program_state.hpp +++ b/src/gallium/drivers/zink/zink_program_state.hpp @@ -38,10 +38,12 @@ /* runtime-optimized pipeline state hashing */ template static uint32_t -hash_gfx_pipeline_state(const void *key) +hash_gfx_pipeline_state(const void *key, struct zink_screen *screen) { const struct zink_gfx_pipeline_state *state = (const struct zink_gfx_pipeline_state *)key; - uint32_t hash = _mesa_hash_data(key, offsetof(struct zink_gfx_pipeline_state, hash)); + uint32_t hash = _mesa_hash_data(key, screen->have_full_ds3 ? + offsetof(struct zink_gfx_pipeline_state, sample_mask) : + offsetof(struct zink_gfx_pipeline_state, hash)); if (DYNAMIC_STATE < ZINK_DYNAMIC_STATE2) hash = XXH32(&state->dyn_state3, sizeof(state->dyn_state3), hash); if (DYNAMIC_STATE < ZINK_DYNAMIC_STATE3) @@ -119,7 +121,7 @@ zink_get_gfx_pipeline(struct zink_context *ctx, if (state->dirty) { if (state->pipeline) //avoid on first hash state->final_hash ^= state->hash; - state->hash = hash_gfx_pipeline_state(state); + state->hash = hash_gfx_pipeline_state(state, screen); state->final_hash ^= state->hash; state->dirty = false; } -- 2.7.4