aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-05-28 19:25:20 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:18:20 -0600
commitdcdea9b53595cf359135185e5726f849ca2a5b1d (patch)
treeeaea4635ed17e99a4b27c5ddd3c6b5d64bba5911
parent1c3d9f0ff936698e138685aedb707e24336b03d8 (diff)
downloadusermoji-dcdea9b53595cf359135185e5726f849ca2a5b1d.tar.xz
loader: Remove storage of wrappedGPUs only need during layer activation
-rw-r--r--loader/loader.c10
-rw-r--r--loader/loader.h1
2 files changed, 5 insertions, 6 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 74108ff9..6a8e25c6 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -514,7 +514,6 @@ static void loader_icd_destroy(
ptr_inst->total_icd_count--;
free(icd->gpus);
free(icd->loader_dispatch);
- //TODO free wrappedGpus or remove them
free(icd);
}
@@ -1337,7 +1336,7 @@ extern uint32_t loader_activate_device_layers(
VkObject baseObj = nextObj;
VkBaseLayerObject *nextGpuObj;
PFN_vkGetDeviceProcAddr nextGPA = icd->GetDeviceProcAddr;
-
+ VkBaseLayerObject *wrappedGpus;
count = 0;
for (uint32_t i = 0; i < icd->enabled_device_extensions[gpu_index].count; i++) {
struct loader_extension_property *ext_prop = &icd->enabled_device_extensions[gpu_index].list[i];
@@ -1350,8 +1349,8 @@ extern uint32_t loader_activate_device_layers(
icd->layer_count[gpu_index] = count;
- icd->wrappedGpus[gpu_index] = malloc(sizeof(VkBaseLayerObject) * icd->layer_count[gpu_index]);
- if (! icd->wrappedGpus[gpu_index]) {
+ wrappedGpus = malloc(sizeof(VkBaseLayerObject) * icd->layer_count[gpu_index]);
+ if (! wrappedGpus) {
loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Failed to malloc Gpu objects for layer");
return 0;
}
@@ -1364,7 +1363,7 @@ extern uint32_t loader_activate_device_layers(
continue;
}
- nextGpuObj = (icd->wrappedGpus[gpu_index] + i);
+ nextGpuObj = (wrappedGpus + i);
nextGpuObj->pGPA = nextGPA;
nextGpuObj->baseObject = baseObj;
nextGpuObj->nextObject = nextObj;
@@ -1389,6 +1388,7 @@ extern uint32_t loader_activate_device_layers(
loader_init_device_dispatch_table(icd->loader_dispatch + gpu_index, nextGPA,
(VkPhysicalDevice) nextObj, (VkPhysicalDevice) baseObj);
+ free(wrappedGpus);
} else {
// TODO: Check that active layers match requested?
}
diff --git a/loader/loader.h b/loader/loader.h
index 2a774a59..c333f028 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -97,7 +97,6 @@ struct loader_icd {
VkLayerDispatchTable *loader_dispatch;
uint32_t layer_count[MAX_GPUS_FOR_LAYER];
- VkBaseLayerObject *wrappedGpus[MAX_GPUS_FOR_LAYER];
uint32_t gpu_count;
VkPhysicalDevice *gpus;
VkInstance instance; // instance object from the icd