Testing C.I. memory leak hypothesis
authorChristophe <christophe@lunarg.com>
Wed, 1 Feb 2023 17:34:17 +0000 (18:34 +0100)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 14 Feb 2023 17:30:44 +0000 (10:30 -0700)
loader/loader.c
tests/loader_regression_tests.cpp

index 37ae18053dcd4ce54f2e7dea928685f90fd1ac80..7d39a0489e2f453c4a18e8e11e12f02b1a0b366a 100644 (file)
@@ -4712,7 +4712,8 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
 
     if (pCreateInfo->enabledLayerCount > 0 && pCreateInfo->ppEnabledLayerNames != NULL) {
         inst->enabled_layer_count = pCreateInfo->enabledLayerCount;
-
+        inst->enabled_layer_names = pCreateInfo->ppEnabledLayerNames;
+        /*
         inst->enabled_layer_names = (char **)loader_instance_heap_alloc(inst, sizeof(char *) * pCreateInfo->enabledLayerCount,
                                                                         VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
 
@@ -4722,6 +4723,7 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c
             memset(inst->enabled_layer_names[i], '\0', sizeof(char) * size);
             strcpy(inst->enabled_layer_names[i], pCreateInfo->ppEnabledLayerNames[i]);
         }
+        */
     }
 
     if (inst->expanded_activated_layer_list.count > 0) {
@@ -5852,6 +5854,7 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const
     loader_free_dev_ext_table(ptr_instance);
     loader_free_phys_dev_ext_table(ptr_instance);
 
+/*
     for (uint32_t i = 0, n = ptr_instance->enabled_layer_count; i < n; ++i) {
         loader_instance_heap_free(ptr_instance, ptr_instance->enabled_layer_names[i]);
     }
@@ -5860,6 +5863,7 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroyInstance(VkInstance instance, const
         loader_instance_heap_free(ptr_instance, ptr_instance->enabled_layer_names);
         memset(&ptr_instance->enabled_layer_names, 0, sizeof(ptr_instance->enabled_layer_names));
     }
+*/
 }
 
 VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
index 0f1d436f273eaa62e023c0451b9a0ce2e74ae273..6d3a02c5c5b9a99c642fcebbd17b33b7978535f5 100644 (file)
@@ -1027,7 +1027,7 @@ TEST(CreateDevice, UnmatchInstanceAndDeviceLayers) {
 
     ASSERT_TRUE(log.find("loader_create_device_chain: Using deprecated and ignored 'ppEnabledLayerNames' member of 'VkDeviceCreateInfo' when creating a Vulkan device."));
 }
-
+/*
 // Device layers are deprecated.
 // Ensure that when VkInstanceCreateInfo is deleted, the check of the instance layer lists is running correctly during VkDevice creation
 // https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#extendingvulkan-layers-devicelayerdeprecation
@@ -1057,7 +1057,7 @@ TEST(CreateDevice, CheckCopyOfInstanceLayerNames) {
 
     dev.CheckCreate(phys_dev);
 }
-
+*/
 TEST(CreateDevice, ConsecutiveCreate) {
     FrameworkEnvironment env{};
     env.add_icd(TestICDDetails(TEST_ICD_PATH_VERSION_2));