From 7bdaf6e95f79d3c159ae6418ac403c0aba550ed4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Apr 2024 09:57:17 -0400 Subject: [PATCH] zink: use zink_shader_key_optimal unions for pipeline state asserts no functional changes, just easier to debug fails Part-of: --- src/gallium/drivers/zink/zink_program_state.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_program_state.hpp b/src/gallium/drivers/zink/zink_program_state.hpp index 2cabc6786606c..9badd47eb693e 100644 --- a/src/gallium/drivers/zink/zink_program_state.hpp +++ b/src/gallium/drivers/zink/zink_program_state.hpp @@ -128,9 +128,9 @@ zink_get_gfx_pipeline(struct zink_context *ctx, /* extra safety asserts for optimal path to catch refactoring bugs */ if (prog->optimal_keys) { ASSERTED const union zink_shader_key_optimal *opt = (union zink_shader_key_optimal*)&prog->last_variant_hash; - ASSERTED uint32_t sanitized = zink_sanitize_optimal_key(ctx->gfx_stages, ctx->gfx_pipeline_state.shader_keys_optimal.key.val); - assert(opt->val == sanitized); - assert(state->optimal_key == sanitized); + ASSERTED union zink_shader_key_optimal sanitized{.val = zink_sanitize_optimal_key(ctx->gfx_stages, ctx->gfx_pipeline_state.shader_keys_optimal.key.val)}; + assert(opt->val == sanitized.val); + assert(state->optimal_key == sanitized.val); } /* recalc vertex state if missing optimal extensions */ if (DYNAMIC_STATE != ZINK_DYNAMIC_VERTEX_INPUT2 && DYNAMIC_STATE != ZINK_DYNAMIC_VERTEX_INPUT && ctx->vertex_state_changed) {