From 444b7cd3eecd538e7cb87027a07c6fb1c0abc6b8 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 7 Apr 2020 13:12:53 -0600 Subject: mockicd: Make physical device static PDev created at EnumPhysDevices time, but destroyed at DestroyInstance time. This crashes as EnumPhysDevices is not required to be called. Change-Id: I2dbfb694364eab57e5173565db795c5c70d458fc --- scripts/mock_icd_generator.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 33f2cad8..fff1d7ca 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -57,7 +57,7 @@ using std::unordered_map; // Map device memory handle to any mapped allocations that we'll need to free on unmap static unordered_map> mapped_memory_map; -static VkPhysicalDevice physical_device = nullptr; +static VkPhysicalDevice physical_device = (VkPhysicalDevice)CreateDispObjHandle(); static unordered_map>> queue_map; static unordered_map> buffer_map; @@ -425,16 +425,10 @@ CUSTOM_C_INTERCEPTS = { return VK_SUCCESS; ''', 'vkDestroyInstance': ''' - // Destroy physical device - DestroyDispObjHandle((void*)physical_device); - DestroyDispObjHandle((void*)instance); ''', 'vkEnumeratePhysicalDevices': ''' if (pPhysicalDevices) { - if (!physical_device) { - physical_device = (VkPhysicalDevice)CreateDispObjHandle(); - } *pPhysicalDevices = physical_device; } else { *pPhysicalDeviceCount = 1; -- cgit v1.2.3