From 7edef26a63efa90b95bf0565e91b2b66e75d4afe Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 27 Jun 2016 15:13:00 -0600 Subject: layers: Add phyDevProps call to Param Validation Change-Id: I3a8249c741d1695675842f1be09d3d63a92f900d --- layers/parameter_validation.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index 4be50316..b3bf5d05 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -67,8 +67,10 @@ struct layer_data { // Device Data // Map for queue family index to queue count std::unordered_map queueFamilyIndexMap; + VkPhysicalDeviceLimits device_limits; - layer_data() : report_data(nullptr), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr), tmp_callbacks(nullptr){}; + layer_data() + : report_data(nullptr), num_tmp_callbacks(0), tmp_dbg_create_infos(nullptr), tmp_callbacks(nullptr), device_limits{} {}; }; static std::unordered_map layer_data_map; @@ -1640,15 +1642,20 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevice, my_device_data->report_data = layer_debug_report_create_device(my_instance_data->report_data, *pDevice); initDeviceTable(*pDevice, fpGetDeviceProcAddr, pc_device_table_map); + uint32_t count; - get_dispatch_table(pc_instance_table_map, physicalDevice) - ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); + VkLayerInstanceDispatchTable *instance_dispatch_table = get_dispatch_table(pc_instance_table_map, physicalDevice); + instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, nullptr); std::vector properties(count); - get_dispatch_table(pc_instance_table_map, physicalDevice) - ->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); + instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, &count, &properties[0]); validateDeviceCreateInfo(physicalDevice, pCreateInfo, properties); storeCreateDeviceData(*pDevice, pCreateInfo); + + // Query and save physical device limits for this device + VkPhysicalDeviceProperties device_properties = {}; + instance_dispatch_table->GetPhysicalDeviceProperties(physicalDevice, &device_properties); + memcpy(&my_device_data->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits)); } } -- cgit v1.2.3