diff options
| author | John Zulauf <jzulauf@lunarg.com> | 2018-01-24 11:54:05 -0700 |
|---|---|---|
| committer | jzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com> | 2018-01-31 09:12:35 -0700 |
| commit | 1fdbcf2c5e4415e586a4baecbdacf315090eb137 (patch) | |
| tree | a32482df659cc557374206c12983f78370eb28c5 /layers/descriptor_sets.cpp | |
| parent | 79769a769106bd58047d30e9be871527776a4ca1 (diff) | |
| download | usermoji-1fdbcf2c5e4415e586a4baecbdacf315090eb137.tar.xz | |
layers: Add check for push descriptor allocation
Add validation check for attempting to use vkAllocateDescriptorSets with
a descriptor set layout create with the push descriptor flag
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set.
Checks added:
VALIDATION_ERROR_04c00268
VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308
Change-Id: I81bed8e7eb5396f7a716b6a14b648b5051127259
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 1adc81d5..95f81c76 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -1824,12 +1824,16 @@ bool cvdescriptorset::ValidateAllocateDescriptorSets(const core_validation::laye for (uint32_t i = 0; i < p_alloc_info->descriptorSetCount; i++) { auto layout = GetDescriptorSetLayout(dev_data, p_alloc_info->pSetLayouts[i]); - if (!layout) { - skip |= - log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, - HandleToUint64(p_alloc_info->pSetLayouts[i]), __LINE__, DRAWSTATE_INVALID_LAYOUT, "DS", - "Unable to find set layout node for layout 0x%" PRIxLEAST64 " specified in vkAllocateDescriptorSets() call", - HandleToUint64(p_alloc_info->pSetLayouts[i])); + if (layout) { // nullptr layout indicates no valid layout handle for this device, validated/logged in object_tracker + if (layout->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, + HandleToUint64(p_alloc_info->pSetLayouts[i]), __LINE__, VALIDATION_ERROR_04c00268, "DS", + "Layout 0x%" PRIxLEAST64 " specified at pSetLayouts[%" PRIu32 + "] in vkAllocateDescriptorSets() was created with invalid flag %s set. %s", + HandleToUint64(p_alloc_info->pSetLayouts[i]), i, + "VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR", + validation_error_map[VALIDATION_ERROR_04c00268]); + } } } if (!GetDeviceExtensions(dev_data)->vk_khr_maintenance1) { |
