From 8b0b1f5d39f577b6869af8860ef6d2e8691b7e1b Mon Sep 17 00:00:00 2001 From: Lina Versace Date: Fri, 4 Aug 2023 11:11:28 -0700 Subject: [PATCH] venus: Drop incorrectly-used always-true pipeline vars When writing vn_fix_graphics_pipeline_create_info() long ago, I defined some always-true dummy vars that represented some VkGraphicsPipelineLibraryFlagsEXT. In the conditions that decide which state to fixup, I used the dummy vars. My intent was that this would ease the implementation of VK_EXT_graphics_pipeline_library, because some of the GPL fixup logic would already be present. I was wrong. After I studied GPL more, I discovered that the conditions were using the dummy vars incorrectly. The incorrect usage produced no bugs, because the vars are always true. Delete the dummy vars. Signed-off-by: Lina Versace Reviewed-by: Yiwei Zhang Part-of: --- src/virtio/vulkan/vn_pipeline.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/virtio/vulkan/vn_pipeline.c b/src/virtio/vulkan/vn_pipeline.c index c566e28..48db936 100644 --- a/src/virtio/vulkan/vn_pipeline.c +++ b/src/virtio/vulkan/vn_pipeline.c @@ -496,23 +496,6 @@ vn_fix_graphics_pipeline_create_info( * bools. */ - /* VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT - * - * The Vulkan spec (1.3.223) says: - * If the pre-rasterization shader state includes a vertex shader, - * then vertex input state is included in a complete graphics pipeline. - * - * We support no extension yet that allows the vertex stage to be - * omitted such as VK_EXT_graphics_pipeline_library. - * - * VK_EXT_vertex_input_dynamic_state allows for the state to be set - * dynamically but vertex stage must be included regardless. - */ - const bool UNUSED has_vertex_input_state = true; - - /* VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT */ - const bool has_pre_raster_state = true; - /* The spec does not assign a name to this state. We define it just to * deduplicate code. * @@ -548,8 +531,7 @@ vn_fix_graphics_pipeline_create_info( * VUID-VkGraphicsPipelineCreateInfo-rasterizerDiscardEnable-00750 * VUID-VkGraphicsPipelineCreateInfo-pViewportState-04892 */ - if (info->pViewportState && - !(has_pre_raster_state && has_raster_state)) { + if (info->pViewportState && !has_raster_state) { fix.ignore_viewport_state = true; any_fix = true; } @@ -564,8 +546,8 @@ vn_fix_graphics_pipeline_create_info( info->pViewportState->pViewports && info->pViewportState->viewportCount) { const bool has_dynamic_viewport = - has_pre_raster_state && (has_dynamic_state.viewport || - has_dynamic_state.viewport_with_count); + has_dynamic_state.viewport || + has_dynamic_state.viewport_with_count; if (has_dynamic_viewport) { fix.ignore_viewports = true; @@ -583,8 +565,7 @@ vn_fix_graphics_pipeline_create_info( info->pViewportState->pScissors && info->pViewportState->scissorCount) { const bool has_dynamic_scissor = - has_pre_raster_state && (has_dynamic_state.scissor || - has_dynamic_state.scissor_with_count); + has_dynamic_state.scissor || has_dynamic_state.scissor_with_count; if (has_dynamic_scissor) { fix.ignore_scissors = true; any_fix = true; -- 2.7.4