mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-25 00:00:41 +00:00
loader: Prevent crash from VK_KHR_display
Previously, we assumed that the extension VK_KHR_display would be available on all systems. This appears to no longer be the case. If we get two ICDs, one which supports the extension and one which does not, we used to get a crash if trying to call any function from the extension on the physical device which did not support it. This solves that crash
This commit is contained in:
parent
d0f1abe22e
commit
bb8231f05f
10
loader/wsi.c
10
loader/wsi.c
@ -1620,9 +1620,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPropertiesKHR(
|
||||
}
|
||||
|
||||
if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR) {
|
||||
loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
||||
"ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPropertiesKHR!\n");
|
||||
assert(false && "loader: null GetPhysicalDeviceDisplayPropertiesKHR ICD pointer");
|
||||
*pPropertyCount = 0;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return icd_term->dispatch.GetPhysicalDeviceDisplayPropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties);
|
||||
@ -1651,9 +1650,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceDisplayPlanePropertie
|
||||
}
|
||||
|
||||
if (NULL == icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR) {
|
||||
loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
|
||||
"ICD for selected physical device is not exporting vkGetPhysicalDeviceDisplayPlanePropertiesKHR!\n");
|
||||
assert(false && "loader: null GetPhysicalDeviceDisplayPlanePropertiesKHR ICD pointer");
|
||||
*pPropertyCount = 0;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return icd_term->dispatch.GetPhysicalDeviceDisplayPlanePropertiesKHR(phys_dev_term->phys_dev, pPropertyCount, pProperties);
|
||||
|
Loading…
Reference in New Issue
Block a user