From 645dc5b3ef30729e3cc8d17d3fd95fb8c7b5bb9b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 29 Mar 2016 16:57:02 +1300 Subject: [PATCH] layers: Flag difference in patch decoration correctly Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index ae2954fa..70d2bf77 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -1626,11 +1626,9 @@ static bool validate_interface_between_stages(layer_data *my_data, shader_module } b_it++; } else { - if (types_match(producer, consumer, a_it->second.type_id, b_it->second.type_id, + if (!types_match(producer, consumer, a_it->second.type_id, b_it->second.type_id, producer_stage->arrayed_output && !a_it->second.is_patch, consumer_stage->arrayed_input && !b_it->second.is_patch)) { - /* OK! */ - } else { if (log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", "Type mismatch on location %u.%u: '%s' vs '%s'", a_first.first, a_first.second, @@ -1639,6 +1637,16 @@ static bool validate_interface_between_stages(layer_data *my_data, shader_module pass = false; } } + if (a_it->second.is_patch != b_it->second.is_patch) { + 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_INTERFACE_TYPE_MISMATCH, "SC", + "Decoration mismatch on location %u.%u: is per-%s in %s stage but" + "per-%s in %s stage", a_first.first, a_first.second, + a_it->second.is_patch ? "patch" : "vertex", producer_stage->name, + b_it->second.is_patch ? "patch" : "vertex", consumer_stage->name)) { + pass = false; + } + } a_it++; b_it++; } -- 2.34.1