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(); }