From b0e55c4d60d535d94c721865ea8fe48f4e9704f5 Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Tue, 27 Dec 2022 14:35:23 +0100 Subject: [PATCH] vulkan: Allow passing NULL dispatch tables to vk_device_init Reviewed-by: Samuel Pitoiset Part-of: --- src/vulkan/runtime/vk_device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vulkan/runtime/vk_device.c b/src/vulkan/runtime/vk_device.c index 3964be097e3..7768cdc29c3 100644 --- a/src/vulkan/runtime/vk_device.c +++ b/src/vulkan/runtime/vk_device.c @@ -139,11 +139,13 @@ vk_device_init(struct vk_device *device, device->physical = physical_device; - device->dispatch_table = *dispatch_table; + if (dispatch_table) { + device->dispatch_table = *dispatch_table; - /* Add common entrypoints without overwriting driver-provided ones. */ - vk_device_dispatch_table_from_entrypoints( - &device->dispatch_table, &vk_common_device_entrypoints, false); + /* Add common entrypoints without overwriting driver-provided ones. */ + vk_device_dispatch_table_from_entrypoints( + &device->dispatch_table, &vk_common_device_entrypoints, false); + } for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { int idx;