zink: break out pipeline dynamic state2 into struct

easier to expand

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16838>
This commit is contained in:
Mike Blumenkrantz 2022-05-31 15:23:38 -04:00 committed by Marge Bot
parent 7016055c82
commit 76668ae4bd
2 changed files with 7 additions and 5 deletions

View file

@ -46,6 +46,11 @@ struct zink_pipeline_dynamic_state1 {
struct zink_depth_stencil_alpha_hw_state *depth_stencil_alpha_state; //must be last
};
struct zink_pipeline_dynamic_state2 {
bool primitive_restart;
bool rasterizer_discard;
};
struct zink_gfx_pipeline_state {
uint32_t rast_state : ZINK_RAST_HW_STATE_SIZE; //zink_rasterizer_hw_state
uint32_t vertices_per_patch:5;
@ -63,10 +68,7 @@ struct zink_gfx_pipeline_state {
struct zink_pipeline_dynamic_state1 dyn_state1;
struct {
bool primitive_restart;
bool rasterizer_discard;
} dyn_state2;
struct zink_pipeline_dynamic_state2 dyn_state2;
VkShaderModule modules[PIPE_SHADER_TYPES - 1];
bool modules_changed;

View file

@ -268,7 +268,7 @@ equals_gfx_pipeline_state(const void *a, const void *b)
return false;
}
if (!sa->have_EXT_extended_dynamic_state2) {
if (sa->dyn_state2.primitive_restart != sb->dyn_state2.primitive_restart)
if (memcmp(&sa->dyn_state2, &sb->dyn_state2, sizeof(sa->dyn_state2)))
return false;
}
return !memcmp(sa->modules, sb->modules, sizeof(sa->modules)) &&