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: 1deb83fb86 ("vulkan: Add more dynamic multisample states")

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31377>
(cherry picked from commit 101a803858)
This commit is contained in:
Iván Briano 2024-09-25 15:15:20 -07:00 committed by Eric Engestrom
parent 6ca857a801
commit b9d71b960a
2 changed files with 2 additions and 2 deletions

View file

@ -1284,7 +1284,7 @@
"description": "vulkan: use standard sample locations if there's no VkPipelineSampleLocationsStateCreateInfoEXT",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "1deb83fb86d22227a3553f43873b4d4ff9180214",
"notes": null

View file

@ -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)) {