From bfa31de5fd94f9cee6490a373803a5456402861f Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sat, 13 Jan 2024 00:21:30 -0800 Subject: [PATCH] venus: fix to respect the final pipeline layout This fixes VUID-vkCmdDraw-None-08600 violation when running gpl cts: dEQP-VK...graphics_library.misc.bind_null_descriptor_set.*, where the final pipeline layout is falsely dropped, leading to incompatible with the pipeline layout of the bound descriptor set. Fixes: a65ac274acf ("venus: Do pipeline fixes for VK_EXT_graphics_pipeline_library") Signed-off-by: Yiwei Zhang Part-of: (cherry picked from commit 80a5df16fe81d39fd771d5805b141c4eff623886) --- .pick_status.json | 2 +- src/virtio/vulkan/vn_pipeline.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index b54414b58e3..f488b4681a2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -84,7 +84,7 @@ "description": "venus: fix to respect the final pipeline layout", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a65ac274acf250a8f4a5abb030c46b572c3552f4", "notes": null diff --git a/src/virtio/vulkan/vn_pipeline.c b/src/virtio/vulkan/vn_pipeline.c index 5095fcb7568..835b55852de 100644 --- a/src/virtio/vulkan/vn_pipeline.c +++ b/src/virtio/vulkan/vn_pipeline.c @@ -1221,6 +1221,19 @@ vn_graphics_pipeline_state_fill( state->gpl.fragment_output = true; } + /* After direct_gpl states collection, check the final state to validate + * VkPipelineLayout in case of being the final layout in linked pipeline. + * + * From the Vulkan 1.3.275 spec: + * VUID-VkGraphicsPipelineCreateInfo-layout-06602 + * + * If the pipeline requires fragment shader state or pre-rasterization + * shader state, layout must be a valid VkPipelineLayout handle + */ + if ((state->gpl.fragment_shader && !is_raster_statically_disabled) || + state->gpl.pre_raster_shaders) + valid.self.pipeline_layout = true; + /* Pipeline Derivatives * * VUID-VkGraphicsPipelineCreateInfo-flags-07984