dev = next_dev;
}
+ if (icd->phys_devs != NULL)
+ loader_heap_free(ptr_inst, icd->phys_devs);
loader_heap_free(ptr_inst, icd);
}
return VK_ERROR_OUT_OF_HOST_MEMORY;
for (i = 0; idx < copy_count && i < inst->total_icd_count; i++) {
+ icd = phys_devs[i].this_icd;
+ if (icd->phys_devs != NULL) {
+ loader_heap_free(inst, icd->phys_devs);
+ }
+ icd->phys_devs = loader_heap_alloc(inst,
+ sizeof(VkPhysicalDevice) * phys_devs[i].count,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+
for (j = 0; j < phys_devs[i].count && idx < copy_count; j++) {
loader_set_dispatch((void *)&inst->phys_devs_term[idx], inst->disp);
inst->phys_devs_term[idx].this_icd = phys_devs[i].this_icd;
inst->phys_devs_term[idx].phys_dev = phys_devs[i].phys_devs[j];
+ icd->phys_devs[j] = phys_devs[i].phys_devs[j];
pPhysicalDevices[idx] =
(VkPhysicalDevice)&inst->phys_devs_term[idx];
idx++;
// pointers to find other structs
const struct loader_scanned_icds *this_icd_lib;
const struct loader_instance *this_instance;
-
+ VkPhysicalDevice *phys_devs; // physicalDevice object from icd
struct loader_device *logical_device_list;
VkInstance instance; // instance object from the icd
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
+ //TODO handle more than one phys dev per icd (icd->phys_devs[0])
res = loader_add_device_extensions(
- inst, icd, phys_dev->phys_dev,
+ inst, icd, icd->phys_devs[0],
phys_dev->this_icd->this_icd_lib->lib_name, &icd_exts);
if (res != VK_SUCCESS) {
loader_platform_thread_unlock_mutex(&loader_lock);