From e791b2045a47e95b4d63910add3ecdbcacf52d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Iglesias=20Gons=C3=A1lvez?= Date: Fri, 25 Jun 2021 10:14:21 +0200 Subject: [PATCH] anv: do not dereference VkPipelineMultisampleStateCreateInfo always MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VkGraphicsPipelineCreateInfo.pMultisampleState is a pointer to a VkPipelineMultisampleStateCreateInfo structure, and is ignored if the pipeline has rasterization disabled. Fixes a crash in one CTS tests that checks this. Signed-off-by: Samuel Iglesias Gonsálvez Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_pipeline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 2855e36cc17..5f8b9589b4c 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2180,6 +2180,7 @@ copy_non_dynamic_state(struct anv_graphics_pipeline *pipeline, } const VkPipelineMultisampleStateCreateInfo *ms_info = + pCreateInfo->pRasterizationState->rasterizerDiscardEnable ? NULL : pCreateInfo->pMultisampleState; if (states & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS) { const VkPipelineSampleLocationsStateCreateInfoEXT *sl_info = ms_info ?