From 449b96e38d064928482d76314caed474c66a0b71 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 31 May 2022 15:16:03 -0400 Subject: [PATCH] zink: use memcmp for comparing dynamic state1 info easier to expand Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_pipeline.h | 2 +- src/gallium/drivers/zink/zink_program.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_pipeline.h b/src/gallium/drivers/zink/zink_pipeline.h index 8bb323d0568..5da7f859f06 100644 --- a/src/gallium/drivers/zink/zink_pipeline.h +++ b/src/gallium/drivers/zink/zink_pipeline.h @@ -42,7 +42,7 @@ struct zink_vertex_elements_state; struct zink_pipeline_dynamic_state1 { uint8_t front_face; //VkFrontFace:1 uint16_t num_viewports; - struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; + struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //must be last }; struct zink_gfx_pipeline_state { diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 1c56255e546..8cdf3a28869 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -259,7 +259,7 @@ equals_gfx_pipeline_state(const void *a, const void *b) } } if (!sa->have_EXT_extended_dynamic_state) { - if (sa->dyn_state1.front_face != sb->dyn_state1.front_face) + if (memcmp(&sa->dyn_state1, &sb->dyn_state1, offsetof(struct zink_pipeline_dynamic_state1, depth_stencil_alpha_state))) return false; if (!!sa->dyn_state1.depth_stencil_alpha_state != !!sb->dyn_state1.depth_stencil_alpha_state || (sa->dyn_state1.depth_stencil_alpha_state &&