aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@lunarg.com>2018-01-24 11:54:05 -0700
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>2018-01-31 09:12:35 -0700
commit1fdbcf2c5e4415e586a4baecbdacf315090eb137 (patch)
treea32482df659cc557374206c12983f78370eb28c5
parent79769a769106bd58047d30e9be871527776a4ca1 (diff)
downloadusermoji-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
-rw-r--r--layers/descriptor_sets.cpp16
-rw-r--r--layers/vk_validation_error_database.txt2
2 files changed, 11 insertions, 7 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) {
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index f03c3329..3534a631 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -360,7 +360,7 @@ VALIDATION_ERROR_04a30401~^~Y~^~Unknown~^~vkCreateDescriptorPool~^~VUID-VkDescri
VALIDATION_ERROR_04c00009~^~Y~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-commonparent~^~core~^~The spec valid usage text states 'Both of descriptorPool, and the elements of pSetLayouts must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-commonparent)~^~implicit
VALIDATION_ERROR_04c00264~^~Y~^~AllocDescriptorFromEmptyPool~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorSetCount must not be greater than the number of sets that are currently available for allocation in descriptorPool' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-00306)~^~
VALIDATION_ERROR_04c00266~^~Y~^~AllocDescriptorFromEmptyPool~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'descriptorPool must have enough free descriptor capacity remaining to allocate the descriptor sets of the specified layouts' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-00307)~^~
-VALIDATION_ERROR_04c00268~^~N~^~None~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308)~^~
+VALIDATION_ERROR_04c00268~^~Y~^~None~^~VkDescriptorSetAllocateInfo~^~VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308~^~(VK_KHR_push_descriptor)~^~The spec valid usage text states 'Each element of pSetLayouts must not have been created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308)~^~
VALIDATION_ERROR_04c04601~^~Y~^~None~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter~^~core~^~The spec valid usage text states 'descriptorPool must be a valid VkDescriptorPool handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorPool-parameter)~^~implicit
VALIDATION_ERROR_04c04a1b~^~N~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength~^~core~^~The spec valid usage text states 'descriptorSetCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength)~^~implicit
VALIDATION_ERROR_04c1c40d~^~Y~^~Unknown~^~vkAllocateDescriptorSets~^~VUID-VkDescriptorSetAllocateInfo-pNext-pNext~^~core~^~The spec valid usage text states 'pNext must be NULL' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkDescriptorSetAllocateInfo-pNext-pNext)~^~implicit, TBD in parameter validation layer.