layers: fix ShaderChecker hang on stage mismatch
authorMike Stroyan <mike@LunarG.com>
Thu, 10 Sep 2015 20:10:25 +0000 (14:10 -0600)
committerMike Stroyan <mike@LunarG.com>
Tue, 22 Sep 2015 15:37:06 +0000 (09:37 -0600)
validate_interface_between_stages was sometimes iterating past end of maps.

layers/shader_checker.cpp

index 5b2076fbedc45c8cee5b5c0a739511387c7faf0b..7125fc2b8ac6146f51e4c6c702789071f89b2e91 100644 (file)
@@ -699,7 +699,7 @@ validate_interface_between_stages(VkDevice dev,
         auto a_first = a_at_end ? 0 : a_it->first;
         auto b_first = b_at_end ? 0 : b_it->first;
 
-        if (b_at_end || a_first < b_first) {
+        if (b_at_end || ((!a_at_end) && (a_first < b_first))) {
             log_msg(mdd(dev), VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_DEVICE, /*dev*/0, 0, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC",
                     "%s writes to output location %d which is not consumed by %s", producer_name, a_first, consumer_name);
             a_it++;