From: Chris Forbes Date: Thu, 14 Jan 2016 22:32:03 +0000 (+1300) Subject: layers: Fix mishandling of VI vs VS validation (Gitlab#69) X-Git-Tag: submit/tizen/20181227.054638~4093 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8f716f269bf4762d407cd3053d9073c1149ef43;p=platform%2Fupstream%2FVulkan-Tools.git layers: Fix mishandling of VI vs VS validation (Gitlab#69) This wasn't quite correct. We'd end up trying to run it_a off beyond attribs.end(), which is invalid and upsets the MS debug stdlib. This is most likely the root cause of the weirdness that caused people to add _at_end, _first, etc to this function long ago, so that can all disappear -- but for now, let's just deal with the actual bug. Signed-off-by: Chris Forbes --- diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index eabec543..b9d1388d 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -881,14 +881,14 @@ validate_vi_against_vs_inputs(layer_data *my_data, VkDevice dev, VkPipelineVerte bool b_at_end = inputs.size() == 0 || it_b == inputs.end(); auto a_first = a_at_end ? 0 : it_a->first; auto b_first = b_at_end ? 0 : it_b->first; - if (b_at_end || a_first < b_first) { + if (!a_at_end && (b_at_end || a_first < b_first)) { if (log_msg(my_data->report_data, VK_DEBUG_REPORT_PERF_WARN_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, /*dev*/0, __LINE__, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", "Vertex attribute at location %d not consumed by VS", a_first)) { pass = false; } it_a++; } - else if (a_at_end || b_first < a_first) { + else if (!b_at_end && (a_at_end || b_first < a_first)) { if (log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, /*dev*/0, __LINE__, SHADER_CHECKER_INPUT_NOT_PRODUCED, "SC", "VS consumes input at location %d but not provided", b_first)) { pass = false;