diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2020-04-07 13:12:53 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2020-04-07 16:15:34 -0600 |
| commit | 444b7cd3eecd538e7cb87027a07c6fb1c0abc6b8 (patch) | |
| tree | 24ba1a29ae83a81fd1739a155ddc30e3657b24f5 /scripts | |
| parent | 4acb8fe0b1336f3b98fabf741e86e8ab590f6926 (diff) | |
| download | usermoji-444b7cd3eecd538e7cb87027a07c6fb1c0abc6b8.tar.xz | |
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
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/mock_icd_generator.py | 8 |
1 files changed, 1 insertions, 7 deletions
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<VkDeviceMemory, std::vector<void*>> mapped_memory_map; -static VkPhysicalDevice physical_device = nullptr; +static VkPhysicalDevice physical_device = (VkPhysicalDevice)CreateDispObjHandle(); static unordered_map<VkDevice, unordered_map<uint32_t, unordered_map<uint32_t, VkQueue>>> queue_map; static unordered_map<VkDevice, unordered_map<VkBuffer, VkBufferCreateInfo>> 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; |
