diff options
| author | Andre Weissflog <floooh@gmail.com> | 2026-02-03 18:25:46 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2026-02-03 18:25:46 +0100 |
| commit | 18f1c9bfe854df3f3d6e3bb321eb6a56185cb43a (patch) | |
| tree | 4273b3d4b71b6f5bba377a1e497ce086581ea7db /sokol_app.h | |
| parent | 1d7babeab7e950b380f50206a66ff58f8ccf9d3f (diff) | |
sokol_app.h vk: fix case where no suitable physical device is found
Diffstat (limited to 'sokol_app.h')
| -rw-r--r-- | sokol_app.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sokol_app.h b/sokol_app.h index eef6c736..560043e9 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -4432,9 +4432,9 @@ _SOKOL_PRIVATE void _sapp_vk_pick_physical_device(void) { _SAPP_VK_ZERO_COUNT_AND_ARRAY(32, const char*, ext_count, ext_names); ext_count = _sapp_vk_required_device_extensions(ext_names, 32); - VkPhysicalDevice pdev = 0; + VkPhysicalDevice picked_pdev = 0; for (uint32_t pdev_idx = 0; pdev_idx < physical_device_count; pdev_idx++) { - pdev = physical_devices[pdev_idx]; + const VkPhysicalDevice pdev = physical_devices[pdev_idx]; _SAPP_STRUCT(VkPhysicalDeviceProperties, dev_props); vkGetPhysicalDeviceProperties(pdev, &dev_props); if (dev_props.apiVersion < VK_API_VERSION_1_3) { @@ -4468,12 +4468,13 @@ _SOKOL_PRIVATE void _sapp_vk_pick_physical_device(void) { } // if we arrive here, found a suitable device + picked_pdev = pdev; break; } - if (0 == pdev) { + if (0 == picked_pdev) { _SAPP_PANIC(VULKAN_NO_SUITABLE_PHYSICAL_DEVICE_FOUND); } - _sapp.vk.physical_device = pdev; + _sapp.vk.physical_device = picked_pdev; SOKOL_ASSERT(_sapp.vk.physical_device); } |