diff options
| author | Petr Kraus <petr_kraus@email.cz> | 2018-03-13 12:31:27 +0100 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2018-03-20 11:14:18 -0600 |
| commit | 8a4d7f38edc4ecc5ea12938a0be39eb33ca65395 (patch) | |
| tree | 5fee11a4775a2021cdec2da7d1fbfd6937590e68 /layers/parameter_validation_utils.cpp | |
| parent | fcd6dd779c1d61a86bb4830cb148f293513e6e51 (diff) | |
| download | usermoji-8a4d7f38edc4ecc5ea12938a0be39eb33ca65395.tar.xz | |
layers: Check CUBE to have 6+ layers
Diffstat (limited to 'layers/parameter_validation_utils.cpp')
| -rw-r--r-- | layers/parameter_validation_utils.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/layers/parameter_validation_utils.cpp b/layers/parameter_validation_utils.cpp index 583baf4a..bcc4a05d 100644 --- a/layers/parameter_validation_utils.cpp +++ b/layers/parameter_validation_utils.cpp @@ -906,16 +906,23 @@ bool pv_vkCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, con } if (pCreateInfo->imageType == VK_IMAGE_TYPE_2D) { - // If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and - // extent.height must be equal - if ((pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && - (pCreateInfo->extent.width != pCreateInfo->extent.height)) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_09e00774, LayerName, - "vkCreateImage(): if pCreateInfo->imageType is VK_IMAGE_TYPE_2D and pCreateInfo->flags contains " - "VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, pCreateInfo->extent.width and pCreateInfo->extent.height " - "must be equal. %s", - validation_error_map[VALIDATION_ERROR_09e00774]); + if (pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) { + if (pCreateInfo->extent.width != pCreateInfo->extent.height) { + skip |= log_msg( + report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, VK_NULL_HANDLE, __LINE__, + VALIDATION_ERROR_09e00774, LayerName, + "vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but " + "pCreateInfo->extent.width (=%" PRIu32 ") and pCreateInfo->extent.height (=%" PRIu32 ") are not equal. %s", + pCreateInfo->extent.width, pCreateInfo->extent.height, validation_error_map[VALIDATION_ERROR_09e00774]); + } + + if (pCreateInfo->arrayLayers < 6) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + VK_NULL_HANDLE, __LINE__, VALIDATION_ERROR_09e00774, LayerName, + "vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but " + "pCreateInfo->arrayLayers (=%" PRIu32 ") is not greater than or equal to 6. %s", + pCreateInfo->arrayLayers, validation_error_map[VALIDATION_ERROR_09e00774]); + } } if (pCreateInfo->extent.depth != 1) { |
