Module: Mesa
Branch: main
Commit: 7cbdb0b71427a78e3a039e12c4b3e9265a46083a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7cbdb0b71427a78e3a039e12c4b3e9265a46083a

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Jun 21 07:44:28 2023 -0400

zink: set pipeline dynamic state count after all dynamic states are set

Fixes: d17c081b7c6 ("zink: use dynamic state for feedback loops when available")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23766>

---

 src/gallium/drivers/zink/zink_pipeline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_pipeline.c 
b/src/gallium/drivers/zink/zink_pipeline.c
index 72bf0a5ae5b..dabeec0466c 100644
--- a/src/gallium/drivers/zink/zink_pipeline.c
+++ b/src/gallium/drivers/zink/zink_pipeline.c
@@ -329,7 +329,6 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
    VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {0};
    pipelineDynamicStateCreateInfo.sType = 
VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
    pipelineDynamicStateCreateInfo.pDynamicStates = dynamicStateEnables;
-   pipelineDynamicStateCreateInfo.dynamicStateCount = state_count;
 
    VkGraphicsPipelineCreateInfo pci = {0};
    pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
@@ -368,6 +367,7 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
    pci.pViewportState = &viewport_state;
    pci.pDepthStencilState = &depth_stencil_state;
    pci.pDynamicState = &pipelineDynamicStateCreateInfo;
+   pipelineDynamicStateCreateInfo.dynamicStateCount = state_count;
 
    VkPipelineTessellationStateCreateInfo tci = {0};
    VkPipelineTessellationDomainOriginStateCreateInfo tdci = {0};
@@ -560,7 +560,6 @@ zink_create_gfx_pipeline_output(struct zink_screen *screen, 
struct zink_gfx_pipe
    VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {0};
    pipelineDynamicStateCreateInfo.sType = 
VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
    pipelineDynamicStateCreateInfo.pDynamicStates = dynamicStateEnables;
-   pipelineDynamicStateCreateInfo.dynamicStateCount = state_count;
 
    VkGraphicsPipelineCreateInfo pci = {0};
    pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
@@ -585,6 +584,7 @@ zink_create_gfx_pipeline_output(struct zink_screen *screen, 
struct zink_gfx_pipe
    }
    if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB)
       pci.flags |= VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT;
+   pipelineDynamicStateCreateInfo.dynamicStateCount = state_count;
    pci.pColorBlendState = &blend_state;
    pci.pMultisampleState = &ms_state;
    pci.pDynamicState = &pipelineDynamicStateCreateInfo;

Reply via email to