aboutsummaryrefslogtreecommitdiff
path: root/layers/device_limits.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/device_limits.cpp')
-rw-r--r--layers/device_limits.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index e97c54ad..8aa538e5 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -49,6 +49,8 @@ namespace device_limits {
// This struct will be stored in a map hashed by the dispatchable object
struct layer_data {
+ VkInstance instance;
+
debug_report_data *report_data;
std::vector<VkDebugReportCallbackEXT> logging_callback;
VkLayerDispatchTable *device_dispatch_table;
@@ -116,6 +118,7 @@ CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallba
return result;
layer_data *my_data = get_my_data_ptr(get_dispatch_key(*pInstance), layer_data_map);
+ my_data->instance = *pInstance;
my_data->instance_dispatch_table = new VkLayerInstanceDispatchTable;
layer_init_instance_dispatch_table(*pInstance, my_data->instance_dispatch_table, fpGetInstanceProcAddr);
@@ -403,7 +406,7 @@ CreateDevice(VkPhysicalDevice gpu, const VkDeviceCreateInfo *pCreateInfo,
assert(chain_info->u.pLayerInfo);
PFN_vkGetInstanceProcAddr fpGetInstanceProcAddr = chain_info->u.pLayerInfo->pfnNextGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr fpGetDeviceProcAddr = chain_info->u.pLayerInfo->pfnNextGetDeviceProcAddr;
- PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(NULL, "vkCreateDevice");
+ PFN_vkCreateDevice fpCreateDevice = (PFN_vkCreateDevice)fpGetInstanceProcAddr(phy_dev_data->instance, "vkCreateDevice");
if (fpCreateDevice == NULL) {
return VK_ERROR_INITIALIZATION_FAILED;
}