aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-06-08 16:38:48 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:22:55 -0600
commit7f28f3e284c82b8f3fdf036a6bad4335c54683ee (patch)
treedffcbe5048da0bedbf5f969b948dd4f4dea6651b
parentfc3b08cd1673c15ec5742d31356e1cd941c01e08 (diff)
downloadusermoji-7f28f3e284c82b8f3fdf036a6bad4335c54683ee.tar.xz
loader: Move device dispatch table to CreateDevice from EnumeratePhysDev
For now just have a static array for these will fix this in later commit Conflicts: loader/loader.c
-rw-r--r--loader/loader.c10
-rw-r--r--loader/loader.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 315b8580..56df3524 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -515,7 +515,6 @@ static void loader_icd_destroy(
{
ptr_inst->total_icd_count--;
free(icd->gpus);
- free(icd->loader_dispatch);
free(icd);
}
@@ -1504,7 +1503,6 @@ VkResult loader_init_physical_device_info(
icd = ptr_instance->icds;
while (icd) {
- PFN_vkGetDeviceProcAddr get_proc_addr = icd->GetDeviceProcAddr;
n = icd->gpu_count;
icd->gpus = (VkPhysicalDevice *) malloc(n * sizeof(VkPhysicalDevice));
@@ -1518,13 +1516,8 @@ VkResult loader_init_physical_device_info(
icd->gpus);
if ((res == VK_SUCCESS) && (n == icd->gpu_count)) {
- icd->loader_dispatch = (VkLayerDispatchTable *) malloc(n *
- sizeof(VkLayerDispatchTable));
for (unsigned int i = 0; i < n; i++) {
- loader_init_device_dispatch_table(icd->loader_dispatch + i,
- get_proc_addr, icd->gpus[i], icd->gpus[i]);
-
loader_init_dispatch(icd->gpus[i], ptr_instance->disp);
if (!loader_init_ext_list(&icd->device_extension_cache[i])) {
@@ -1637,6 +1630,9 @@ VkResult loader_CreateDevice(
if (res != VK_SUCCESS) {
return res;
}
+ PFN_vkGetDeviceProcAddr get_proc_addr = icd->GetDeviceProcAddr;
+ loader_init_device_dispatch_table(icd->loader_dispatch + gpu_index,
+ get_proc_addr, icd->gpus[gpu_index], icd->gpus[gpu_index]);
VkLayerDispatchTable *dev_disp = icd->loader_dispatch + gpu_index;
loader_init_dispatch(*pDevice, dev_disp);
diff --git a/loader/loader.h b/loader/loader.h
index 7f648860..74478fc5 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -94,7 +94,7 @@ struct loader_scanned_layers {
struct loader_icd {
const struct loader_scanned_icds *scanned_icds;
- VkLayerDispatchTable *loader_dispatch;
+ VkLayerDispatchTable loader_dispatch[MAX_GPUS_FOR_LAYER];
uint32_t layer_count[MAX_GPUS_FOR_LAYER];
uint32_t gpu_count;
VkPhysicalDevice *gpus;