diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-11-23 09:41:12 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-11-23 16:12:36 -0700 |
| commit | 86330edc484b9689ff74b728ca48c1af26f2ac1b (patch) | |
| tree | 3a8175e1be88826f788a1b488aa181aed684a12b | |
| parent | 73a548c8f80490526cf3c15e92f95918491e3e2e (diff) | |
| download | usermoji-86330edc484b9689ff74b728ca48c1af26f2ac1b.tar.xz | |
layers:Separate two error checks
There's separate valid usage language for VkPushConstantRange size
being non-zero and being multiple of 4. Breaking the validation
callbacks to flag these two errors separately along with their
respective unique error enums.
| -rw-r--r-- | layers/core_validation.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index bf6d2627..5d690d73 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7007,13 +7007,20 @@ static bool validatePushConstantRange(const layer_data *dev_data, const uint32_t } } // size needs to be non-zero and a multiple of 4. - // TODO : This check combines VALIDATION_ERROR_00878 & 879, need to break out separately if ((size == 0) || ((size & 0x3) != 0)) { if (0 == strcmp(caller_name, "vkCreatePipelineLayout()")) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - VALIDATION_ERROR_00878, "DS", "%s call has push constants index %u with " - "size %u. Size must be greater than zero and a multiple of 4. %s", - caller_name, index, size, validation_error_map[VALIDATION_ERROR_00878]); + if (size == 0) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, + __LINE__, VALIDATION_ERROR_00878, "DS", "%s call has push constants index %u with " + "size %u. Size must be greater than zero. %s", + caller_name, index, size, validation_error_map[VALIDATION_ERROR_00878]); + } + if (size & 0x3) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, + __LINE__, VALIDATION_ERROR_00879, "DS", "%s call has push constants index %u with " + "size %u. Size must be a multiple of 4. %s", + caller_name, index, size, validation_error_map[VALIDATION_ERROR_00879]); + } } else if (0 == strcmp(caller_name, "vkCmdPushConstants()")) { skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, |
