tests: Add tests for invalid VkDescriptorBufferInfo
Hit 3 new checks just added for VkDescriptorBufferInfo:
1. offset larger than buffer
2. range of 0
3. range larger than buffer size minus offset
Also update descriptor write and copy update error enums to be more clear,
along with also updating documentation.
diff --git a/layers/core_validation_error_enums.h b/layers/core_validation_error_enums.h
index 9a18c37..aeebce7 100644
--- a/layers/core_validation_error_enums.h
+++ b/layers/core_validation_error_enums.h
@@ -89,8 +89,10 @@
DRAWSTATE_CANT_FREE_FROM_NON_FREE_POOL, // Invalid to call
// vkFreeDescriptorSets on Sets
// allocated from a NON_FREE Pool
- DRAWSTATE_INVALID_UPDATE_INDEX, // Index of requested update is invalid for
- // specified descriptors set
+ DRAWSTATE_INVALID_WRITE_UPDATE, // Attempting a write update to a descriptor
+ // set with invalid update state
+ DRAWSTATE_INVALID_COPY_UPDATE, // Attempting copy update to a descriptor set
+ // with invalid state
DRAWSTATE_INVALID_UPDATE_STRUCT, // Struct in DS Update tree is of invalid
// type
DRAWSTATE_NUM_SAMPLES_MISMATCH, // Number of samples in bound PSO does not
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 6aa891a..10463ab 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -874,7 +874,7 @@
std::string error_str;
if (!set_node->ValidateWriteUpdate(report_data, &p_wds[i], &error_str)) {
skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<uint64_t &>(dest_set), __LINE__, DRAWSTATE_INVALID_UPDATE_INDEX, "DS",
+ reinterpret_cast<uint64_t &>(dest_set), __LINE__, DRAWSTATE_INVALID_WRITE_UPDATE, "DS",
"vkUpdateDescriptorsSets() failed write update validation for Descriptor Set 0x%" PRIx64
" with error: %s",
reinterpret_cast<uint64_t &>(dest_set), error_str.c_str());
@@ -904,7 +904,7 @@
if (!dst_node->ValidateCopyUpdate(report_data, &p_cds[i], src_node, &error_str)) {
skip_call |=
log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
- reinterpret_cast<uint64_t &>(dst_set), __LINE__, DRAWSTATE_INVALID_UPDATE_INDEX, "DS",
+ reinterpret_cast<uint64_t &>(dst_set), __LINE__, DRAWSTATE_INVALID_COPY_UPDATE, "DS",
"vkUpdateDescriptorsSets() failed copy update from Descriptor Set 0x%" PRIx64
" to Descriptor Set 0x%" PRIx64 " with error: %s",
reinterpret_cast<uint64_t &>(src_set), reinterpret_cast<uint64_t &>(dst_set), error_str.c_str());
diff --git a/layers/vk_validation_layer_details.md b/layers/vk_validation_layer_details.md
index 3c61781..4f41298 100644
--- a/layers/vk_validation_layer_details.md
+++ b/layers/vk_validation_layer_details.md
@@ -54,7 +54,8 @@
| DS Update Size | DS update out of bounds for given layout section. | DESCRIPTOR_UPDATE_OUT_OF_BOUNDS | vkUpdateDescriptorSets | DSUpdateOutOfBounds CopyDescriptorUpdateErrors | NA |
| Descriptor Pool empty | Attempt to allocate descriptor type from descriptor pool when no more of that type are available to be allocated. | DESCRIPTOR_POOL_EMPTY | vkAllocateDescriptorSets | AllocDescriptorFromEmptyPool | NA |
| Free from NON_FREE Pool | It's invalid to call vkFreeDescriptorSets() on Sets that were allocated from a Pool created with NON_FREE usage. | CANT_FREE_FROM_NON_FREE_POOL | vkFreeDescriptorSets | TODO | NA |
-| DS Update Index | DS update binding too large for layout binding count. | INVALID_UPDATE_INDEX | vkUpdateDescriptorSets | InvalidDSUpdateIndex CopyDescriptorUpdateErrors DSUsageBitsErrors DSAspectBitsErrors | NA |
+| DS Write Update | DS write update with invalid state which includes things like bad update objects, bad update sizes, and bad descriptor binding values. | INVALID_WRITE_UPDATE | vkUpdateDescriptorSets | InvalidDSUpdateIndex CopyDescriptorUpdateErrors DSUsageBitsErrors DSAspectBitsErrors DSBufferInfoErrors | NA |
+| DS Copy Update | DS copy update with invalid state such as bad object state, mis-matched descriptor types or a bad binding index. | INVALID_COPY_UPDATE | vkUpdateDescriptorSets | InvalidDSUpdateIndex CopyDescriptorUpdateErrors DSUsageBitsErrors DSAspectBitsErrors | NA |
| DS Update Type | Verifies that structs in DS Update tree are properly created, currently valid, and of the right type | INVALID_UPDATE_STRUCT | vkUpdateDescriptorSets | InvalidDSUpdateStruct | NA |
| MSAA Sample Count | Verifies that Pipeline, RenderPass, and Subpass sample counts are consistent | NUM_SAMPLES_MISMATCH | vkCmdBindPipeline vkCmdBeginRenderPass vkCmdNextSubpass | NumSamplesMismatch | NA |
| Dynamic Viewport State Binding | Verify that viewport dynamic state bound to Cmd Buffer at Draw time | VIEWPORT_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | DynamicViewportNotBound | NA |