aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@lunarg.com>2018-01-23 11:27:35 -0700
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>2018-01-26 13:00:21 -0700
commit4f6526f13869127a2c4d329f2f8231d3843d4c69 (patch)
tree78bbd4a8dab6fcb9ccd3c644b004a3cc0fbeabec /layers/core_validation.cpp
parent60a77cd6ce28fa8f2d99e693c3f2f178efe19b73 (diff)
downloadusermoji-4f6526f13869127a2c4d329f2f8231d3843d4c69.tar.xz
layers: Add push descriptor set layout create VUID
Add VUID checks to vkCreateDescriptorSetLayout for push descriptor sets. Additional checks include: VALIDATION_ERROR_05000230 VkDescriptorSetLayoutCreateInfo-flags-00280 VALIDATION_ERROR_05000232 VkDescriptorSetLayoutCreateInfo-flags-00281 Also added check for use of VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR when the required extension VK_KHR_push_descriptor is not enabled. Updated CreateDescriptorSetBindingWithIgnoredSamplers test, which violated the above check. Change-Id: Ie009019bbb7859553df92473796a1a929a9464f7
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp18
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,