diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-08-02 10:45:24 -0600 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-08-02 13:58:49 -0600 |
| commit | ae55897d6c2dcd49c097e1b49ed168a877e6470f (patch) | |
| tree | a84ca87cff99b0ce39921b89ccfc986574def453 /layers/parameter_validation.cpp | |
| parent | a1b8c48bfb5ccbb6760e0b34fac5d80768bb4dfe (diff) | |
| download | usermoji-ae55897d6c2dcd49c097e1b49ed168a877e6470f.tar.xz | |
layers: Fix incorrect VUID for negative viewport ht
Layers used the wrong VUID for the checks for negative viewport
height if the extensions were not enabled.
Fixed existing test, added a new test, and updated the database,
and removed special case from validation_stats script.
Change-Id: Ia165e6245990a4fabb3745102b345a7b4f1b0202
Diffstat (limited to 'layers/parameter_validation.cpp')
| -rw-r--r-- | layers/parameter_validation.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index c3c7122f..85d25b27 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -3176,16 +3176,24 @@ static bool preCmdSetViewport(layer_data *my_data, uint32_t first_viewport, uint viewport.width, limits.maxViewportDimensions[0], validation_error_map[VALIDATION_ERROR_15000996]); } - bool invalid_height = (viewport.height <= 0 || viewport.height > limits.maxViewportDimensions[1]); - if ((my_data->extensions.vk_amd_negative_viewport_height || my_data->extensions.vk_khr_maintenance1) && - (viewport.height < 0)) { // VALIDATION_ERROR_1500099c - invalid_height = false; - } - if (invalid_height) { - skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - VALIDATION_ERROR_1500099a, LayerName, + if (my_data->extensions.vk_amd_negative_viewport_height || my_data->extensions.vk_khr_maintenance1) { + // Check lower bound against negative viewport height instead of zero + if (viewport.height <= -(static_cast<int32_t>(limits.maxViewportDimensions[1])) || + (viewport.height > limits.maxViewportDimensions[1])) { + skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_1500099a, LayerName, + "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (-%u,%u). %s", viewportIndex, + viewport.height, limits.maxViewportDimensions[1], limits.maxViewportDimensions[1], + validation_error_map[VALIDATION_ERROR_1500099a]); + } + } else { + if ((viewport.height <= 0) || (viewport.height > limits.maxViewportDimensions[1])) { + skip |= + log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, + VALIDATION_ERROR_15000998, LayerName, "vkCmdSetViewport %d: height (%f) exceeds permitted bounds (0,%u). %s", viewportIndex, - viewport.height, limits.maxViewportDimensions[1], validation_error_map[VALIDATION_ERROR_1500099a]); + viewport.height, limits.maxViewportDimensions[1], validation_error_map[VALIDATION_ERROR_15000998]); + } } if (viewport.x < limits.viewportBoundsRange[0] || viewport.x > limits.viewportBoundsRange[1]) { |
