From 101a803858e7ffdaf50d3adf571a6a566463276f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Wed, 25 Sep 2024 15:15:20 -0700 Subject: [PATCH] vulkan: use standard sample locations if there's no VkPipelineSampleLocationsStateCreateInfoEXT If the pipeline is created with no VkPipelineSampleLocationsStateCreateInfoEXT, but VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT is set, we end up dereferencing a NULL pointer. Fixes future dEQP-VK.pipeline.*.extended_dynamic_state.*.sample_locations_enable_no_create_info Fixes: 1deb83fb86d ("vulkan: Add more dynamic multisample states") Reviewed-by: Faith Ekstrand Part-of: --- src/vulkan/runtime/vk_graphics_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/runtime/vk_graphics_state.c b/src/vulkan/runtime/vk_graphics_state.c index 25d955d6d39..cb848c736bf 100644 --- a/src/vulkan/runtime/vk_graphics_state.c +++ b/src/vulkan/runtime/vk_graphics_state.c @@ -782,7 +782,7 @@ vk_multisample_sample_locations_state_init( assert(ms->sample_locations == NULL); if (!IS_DYNAMIC(MS_SAMPLE_LOCATIONS)) { - if (ms->sample_locations_enable) { + if (sl_info && ms->sample_locations_enable) { vk_sample_locations_state_init(sl, &sl_info->sampleLocationsInfo); ms->sample_locations = sl; } else if (!IS_DYNAMIC(MS_RASTERIZATION_SAMPLES)) {