diff options
| author | Tobin Ehlis <tobine@google.com> | 2017-01-02 10:04:56 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-01-03 05:44:52 -0700 |
| commit | 09ca7152917a660b85093895009e15b523f7fc26 (patch) | |
| tree | 0b5d25d8c2c340fd8b03ea446f7123343adf414d /layers/core_validation.cpp | |
| parent | d625d925f16cf0548b9ac65db8404210f0f67d2e (diff) | |
| download | usermoji-09ca7152917a660b85093895009e15b523f7fc26.tar.xz | |
layers:Only flag one aspect error at a time
For image aspect bit errors, first flag the error if correct bit is not
set, else flag error if additional bits are incorrectly set. There's
not a real benefit to flagging both errors and it complicates testing.
Generally the first error should be sufficient to allow a user to
correctly update their aspect bit usage.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 6293a3c9..f3ed5370 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6512,8 +6512,7 @@ static bool ValidateImageAspectMask(layer_data *dev_data, VkImage image, VkForma (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Color image formats must have the VK_IMAGE_ASPECT_COLOR_BIT set. %s", func_name, validation_error_map[VALIDATION_ERROR_00741]); - } - if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != aspect_mask) { + } else if ((aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != aspect_mask) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Color image formats must have ONLY the VK_IMAGE_ASPECT_COLOR_BIT set. %s", func_name, @@ -6526,8 +6525,7 @@ static bool ValidateImageAspectMask(layer_data *dev_data, VkImage image, VkForma "at least one of VK_IMAGE_ASPECT_DEPTH_BIT " "and VK_IMAGE_ASPECT_STENCIL_BIT set. %s", func_name, validation_error_map[VALIDATION_ERROR_00741]); - } - if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != aspect_mask) { + } else if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != aspect_mask) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Combination depth/stencil image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT and " @@ -6540,8 +6538,7 @@ static bool ValidateImageAspectMask(layer_data *dev_data, VkImage image, VkForma (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Depth-only image formats must have the VK_IMAGE_ASPECT_DEPTH_BIT set. %s", func_name, validation_error_map[VALIDATION_ERROR_00741]); - } - if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != aspect_mask) { + } else if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != aspect_mask) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Depth-only image formats can have only the VK_IMAGE_ASPECT_DEPTH_BIT set. %s", func_name, @@ -6553,8 +6550,7 @@ static bool ValidateImageAspectMask(layer_data *dev_data, VkImage image, VkForma (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Stencil-only image formats must have the VK_IMAGE_ASPECT_STENCIL_BIT set. %s", func_name, validation_error_map[VALIDATION_ERROR_00741]); - } - if ((aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != aspect_mask) { + } else if ((aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != aspect_mask) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, (uint64_t)image, __LINE__, VALIDATION_ERROR_00741, "IMAGE", "%s: Stencil-only image formats can have only the VK_IMAGE_ASPECT_STENCIL_BIT set. %s", func_name, |
