Fixed bugs in check_device_extension_support

This commit is contained in:
Charles Giessen 2020-03-11 21:19:31 -06:00
parent bfcc4c6bfa
commit dde974d912

View File

@ -288,7 +288,8 @@ detail::Expected<Instance, detail::Error<InstanceError>> InstanceBuilder::build
uint32_t api_version = VK_MAKE_VERSION (1, 0, 0); uint32_t api_version = VK_MAKE_VERSION (1, 0, 0);
if (info.required_api_version > VK_MAKE_VERSION (1, 0, 0) || info.desired_api_version > VK_MAKE_VERSION (1, 0, 0)) { if (info.required_api_version > VK_MAKE_VERSION (1, 0, 0) ||
info.desired_api_version > VK_MAKE_VERSION (1, 0, 0)) {
PFN_vkEnumerateInstanceVersion pfn_vkEnumerateInstanceVersion; PFN_vkEnumerateInstanceVersion pfn_vkEnumerateInstanceVersion;
detail::get_inst_proc_addr ( detail::get_inst_proc_addr (
pfn_vkEnumerateInstanceVersion, "vkEnumerateInstanceVersion", nullptr, vkGetInstanceProcAddr); pfn_vkEnumerateInstanceVersion, "vkEnumerateInstanceVersion", nullptr, vkGetInstanceProcAddr);
@ -543,10 +544,12 @@ std::vector<const char*> check_device_extension_support (
std::vector<const char*> extensions_to_enable; std::vector<const char*> extensions_to_enable;
for (const auto& extension : available_extensions.value ()) { for (const auto& extension : available_extensions.value ()) {
for (auto& req_ext : desired_extensions) { for (auto& req_ext : desired_extensions) {
if (req_ext == extension.extensionName) extensions_to_enable.push_back (req_ext); if (strcmp (req_ext, extension.extensionName) == 0) {
extensions_to_enable.push_back (req_ext);
break; break;
} }
} }
}
return extensions_to_enable; return extensions_to_enable;
} }