From c11eda45018e2485357d2bd9f408d7761888369d Mon Sep 17 00:00:00 2001 From: Xinyue Date: Tue, 9 Jan 2024 14:01:32 +0800 Subject: [PATCH] fix issues according to review --- pxr/imaging/hgiVulkan/instance.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pxr/imaging/hgiVulkan/instance.cpp b/pxr/imaging/hgiVulkan/instance.cpp index 226cd9508d..faddf70f65 100755 --- a/pxr/imaging/hgiVulkan/instance.cpp +++ b/pxr/imaging/hgiVulkan/instance.cpp @@ -85,8 +85,7 @@ HgiVulkanInstance::HgiVulkanInstance() TF_VERIFY(result == VK_SUCCESS); for (size_t i = 0u; i < numExtensions; ++i) { - std::string extensionName = availableExtensions[i].extensionName; - if (extensionName == VK_EXT_DEBUG_UTILS_EXTENSION_NAME) { + if (strcmp(availableExtensions[i].extensionName, VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) { extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); } } @@ -100,13 +99,14 @@ HgiVulkanInstance::HgiVulkanInstance() TF_VERIFY(result == VK_SUCCESS); for (size_t i = 0u; i < numInstanceLayers; ++i) { - std::string layerName = instanceLayerProps[i].layerName; - std::string layerDesc = instanceLayerProps[i].description; - if (layerName == "VK_LAYER_KHRONOS_validation") { + if (strcmp(instanceLayerProps[i].layerName, "VK_LAYER_KHRONOS_validation") == 0) { instanceLayerList.push_back("VK_LAYER_KHRONOS_validation"); } } + free(availableExtensions); + free(instanceLayerProps); + createInfo.ppEnabledLayerNames = instanceLayerList.data(); createInfo.enabledLayerCount = (uint32_t)instanceLayerList.size(); }