diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-07-01 18:23:58 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-07-06 09:41:25 -0600 |
| commit | efc4323b27dde2e597e47d52ae6ca450d873b549 (patch) | |
| tree | 7ff6f88410060f951349757c22de3f1ac287b99a | |
| parent | 198eba699b3dfe38b9c3457facb6312439848e14 (diff) | |
| download | usermoji-efc4323b27dde2e597e47d52ae6ca450d873b549.tar.xz | |
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.
| -rw-r--r-- | layers/core_validation_error_enums.h | 6 | ||||
| -rw-r--r-- | layers/descriptor_sets.cpp | 4 | ||||
| -rw-r--r-- | layers/vk_validation_layer_details.md | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/layers/core_validation_error_enums.h b/layers/core_validation_error_enums.h index 9a18c376..aeebce7b 100644 --- a/layers/core_validation_error_enums.h +++ b/layers/core_validation_error_enums.h @@ -89,8 +89,10 @@ enum DRAW_STATE_ERROR { 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 6aa891a3..10463ab0 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -874,7 +874,7 @@ bool cvdescriptorset::ValidateUpdateDescriptorSets(const debug_report_data *repo 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 @@ bool cvdescriptorset::ValidateUpdateDescriptorSets(const debug_report_data *repo 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 3c617812..4f41298c 100644 --- a/layers/vk_validation_layer_details.md +++ b/layers/vk_validation_layer_details.md @@ -54,7 +54,8 @@ The Draw State portion of the core validation layer tracks state leading into Dr | 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 | |
