From 201e1ba9dbd7f4b0f173de8a6e9db7b5e6cc38d9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 30 Aug 2022 14:13:51 -0500 Subject: [PATCH] pvr: Only destroy the physcial device if it exists Without this, it segfaults on instance destruction which brings down the Vulkan app if you have the driver installed on your system, even if you have no PowerVR hardware. Reviewed-by: Rajnesh Kanwal Part-of: --- src/imagination/vulkan/pvr_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imagination/vulkan/pvr_device.c b/src/imagination/vulkan/pvr_device.c index 236ccbf37b1..5bc2cc5dff2 100644 --- a/src/imagination/vulkan/pvr_device.c +++ b/src/imagination/vulkan/pvr_device.c @@ -240,7 +240,8 @@ void pvr_DestroyInstance(VkInstance _instance, if (!instance) return; - pvr_physical_device_finish(&instance->physical_device); + if (instance->physical_devices_count > 0) + pvr_physical_device_finish(&instance->physical_device); VG(VALGRIND_DESTROY_MEMPOOL(instance));