diff options
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index b747add6..c36d6477 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -166,6 +166,11 @@ struct layer_data { PHYS_DEV_PROPERTIES_NODE phys_dev_properties = {}; VkPhysicalDeviceMemoryProperties phys_dev_mem_props = {}; VkPhysicalDeviceProperties phys_dev_props = {}; + // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2KHR::pNext chain + struct DeviceExtensionProperties { + uint32_t max_push_descriptors; // from VkPhysicalDevicePushDescriptorPropertiesKHR::maxPushDescriptors + }; + DeviceExtensionProperties phys_dev_ext_props = {}; bool external_sync_warning = false; }; @@ -2173,6 +2178,15 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDevice // Store physical device properties and physical device mem limits into device layer_data structs instance_data->dispatch_table.GetPhysicalDeviceMemoryProperties(gpu, &device_data->phys_dev_mem_props); instance_data->dispatch_table.GetPhysicalDeviceProperties(gpu, &device_data->phys_dev_props); + + if (device_data->extensions.vk_khr_push_descriptor) { + // Get the needed push_descriptor limits + auto push_descriptor_prop = lvl_init_struct<VkPhysicalDevicePushDescriptorPropertiesKHR>(); + auto prop2 = lvl_init_struct<VkPhysicalDeviceProperties2KHR>(&push_descriptor_prop); + instance_data->dispatch_table.GetPhysicalDeviceProperties2KHR(gpu, &prop2); + device_data->phys_dev_ext_props.max_push_descriptors = push_descriptor_prop.maxPushDescriptors; + } + lock.unlock(); ValidateLayerOrdering(*pCreateInfo); @@ -4704,7 +4718,9 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateSampler(VkDevice device, const VkSamplerCre static bool PreCallValidateCreateDescriptorSetLayout(layer_data *dev_data, const VkDescriptorSetLayoutCreateInfo *create_info) { if (dev_data->instance_data->disabled.create_descriptor_set_layout) return false; - return cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo(dev_data->report_data, create_info); + return cvdescriptorset::DescriptorSetLayout::ValidateCreateInfo(dev_data->report_data, create_info, + dev_data->extensions.vk_khr_push_descriptor, + dev_data->phys_dev_ext_props.max_push_descriptors); } static void PostCallRecordCreateDescriptorSetLayout(layer_data *dev_data, const VkDescriptorSetLayoutCreateInfo *create_info, |
