PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *dev, const char *pName) {
PFN_vkVoidFunction addr = NULL;
- if (dev == NULL)
- {
- return addr;
- }
-
// ---- VK_KHR_swapchain extension commands
if (dev->extensions.khr_swapchain_enabled) {
if(!strcmp(pName, "vkCreateSwapchainKHR")) {
struct loader_device *dev;
struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, NULL);
- if (NULL == icd_term) {
+ if (NULL == icd_term || NULL == dev) {
return VK_ERROR_INITIALIZATION_FAILED;
}
loader_set_dispatch(object, &dev->loader_dispatch);
// object before passing the appropriate info along to the ICD.
// This is why we also have to override the direct ICD call to
// vkGetDeviceProcAddr to intercept those calls.
- PFN_vkVoidFunction addr = get_extension_device_proc_terminator(dev, pName);
- if (NULL != addr) {
- return addr;
+ if(NULL != dev) {
+ PFN_vkVoidFunction addr = get_extension_device_proc_terminator(dev, pName);
+ if (NULL != addr) {
+ return addr;
+ }
}
return icd_term->dispatch.GetDeviceProcAddr(device, pName);