From: Mike Blumenkrantz Date: Mon, 28 Sep 2020 18:21:52 +0000 (-0400) Subject: zink: make dynamic state usage in pipeline creation more explicit/flexible X-Git-Tag: upstream/21.2.3~7269 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d0434bf6417c386a3e7fd31e2fa52ba37a6ff60;p=platform%2Fupstream%2Fmesa.git zink: make dynamic state usage in pipeline creation more explicit/flexible we'll be expanding this, so we want to have it very easy to update and read Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/drivers/zink/zink_pipeline.c b/src/gallium/drivers/zink/zink_pipeline.c index 3c7ccce..c1e2245 100644 --- a/src/gallium/drivers/zink/zink_pipeline.c +++ b/src/gallium/drivers/zink/zink_pipeline.c @@ -126,19 +126,25 @@ zink_create_gfx_pipeline(struct zink_screen *screen, depth_stencil_state.back = state->depth_stencil_alpha_state->stencil_back; depth_stencil_state.depthWriteEnable = state->depth_stencil_alpha_state->depth_write; - VkDynamicState dynamicStateEnables[] = { - screen->info.have_EXT_extended_dynamic_state ? VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT : VK_DYNAMIC_STATE_VIEWPORT, - screen->info.have_EXT_extended_dynamic_state ? VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT : VK_DYNAMIC_STATE_SCISSOR, + VkDynamicState dynamicStateEnables[24] = { VK_DYNAMIC_STATE_LINE_WIDTH, VK_DYNAMIC_STATE_DEPTH_BIAS, VK_DYNAMIC_STATE_BLEND_CONSTANTS, VK_DYNAMIC_STATE_STENCIL_REFERENCE, }; + unsigned state_count = 4; + if (screen->info.have_EXT_extended_dynamic_state) { + dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT; + dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT; + } else { + dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_VIEWPORT; + dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_SCISSOR; + } VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {}; pipelineDynamicStateCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; pipelineDynamicStateCreateInfo.pDynamicStates = dynamicStateEnables; - pipelineDynamicStateCreateInfo.dynamicStateCount = ARRAY_SIZE(dynamicStateEnables); + pipelineDynamicStateCreateInfo.dynamicStateCount = state_count; VkGraphicsPipelineCreateInfo pci = {}; pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;