From: Matt Coster Date: Fri, 9 Jun 2023 15:53:59 +0000 (+0100) Subject: pvr: Correctly read dynamic state setup during blend constant setup X-Git-Tag: upstream/23.3.3~6596 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1e2e01f62f247ebeae4a4230c49067c431fe5f3;p=platform%2Fupstream%2Fmesa.git pvr: Correctly read dynamic state setup during blend constant setup Somewhat counterintuitively, dynamic_state.set contains the bits that have been loaded from static state, i.e. those that are _not_ dynamic. Signed-off-by: Matt Coster Reviewed-by: Karmjit Mahil Part-of: --- diff --git a/src/imagination/vulkan/pvr_pipeline.c b/src/imagination/vulkan/pvr_pipeline.c index f26500f..ae26b9b 100644 --- a/src/imagination/vulkan/pvr_pipeline.c +++ b/src/imagination/vulkan/pvr_pipeline.c @@ -1611,17 +1611,15 @@ static bool pvr_blend_factor_requires_consts(VkBlendFactor factor) static bool pvr_graphics_pipeline_requires_dynamic_blend_consts( const struct pvr_graphics_pipeline *gfx_pipeline) { - const bool has_dynamic_blend_consts = - BITSET_TEST(gfx_pipeline->dynamic_state.set, - MESA_VK_DYNAMIC_CB_BLEND_CONSTANTS); + const struct vk_dynamic_graphics_state *const state = + &gfx_pipeline->dynamic_state; - if (!has_dynamic_blend_consts) + if (BITSET_TEST(state->set, MESA_VK_DYNAMIC_CB_BLEND_CONSTANTS)) return false; - for (uint32_t i = 0; i < gfx_pipeline->dynamic_state.cb.attachment_count; - i++) { + for (uint32_t i = 0; i < state->cb.attachment_count; i++) { const struct vk_color_blend_attachment_state *attachment = - &gfx_pipeline->dynamic_state.cb.attachments[i]; + &state->cb.attachments[i]; const bool has_color_write = attachment->write_mask &