layers: Downgrade FS output / attachment matching issues to warnings
The spec doesn't say these are invalid; only that the values produced
will be undefined.
diff --git a/layers/shader_validation.cpp b/layers/shader_validation.cpp
index 85edd86..d20f60c 100644
--- a/layers/shader_validation.cpp
+++ b/layers/shader_validation.cpp
@@ -899,9 +899,10 @@
// shader to not produce a matching output.
if (!used) {
if (pipeline->attachments[it_b->first].colorWriteMask != 0) {
- skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
HandleToUint64(fs->vk_shader_module), kVUID_Core_Shader_InputNotProduced,
- "Attachment %d not written by fragment shader", it_b->first);
+ "Attachment %d not written by fragment shader; undefined values will be written to attachment",
+ it_b->first);
}
}
used = false;
@@ -912,10 +913,11 @@
// Type checking
if (!(output_type & att_type)) {
- skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
- HandleToUint64(fs->vk_shader_module), kVUID_Core_Shader_InterfaceTypeMismatch,
- "Attachment %d of type `%s` does not match fragment shader output type of `%s`", it_b->first,
- string_VkFormat(it_b->second), DescribeType(fs, it_a->second.type_id).c_str());
+ skip |= log_msg(
+ report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT,
+ HandleToUint64(fs->vk_shader_module), kVUID_Core_Shader_InterfaceTypeMismatch,
+ "Attachment %d of type `%s` does not match fragment shader output type of `%s`; resulting values are undefined",
+ it_b->first, string_VkFormat(it_b->second), DescribeType(fs, it_a->second.type_id).c_str());
}
// OK!
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 15df4d5..29ab84a 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -19058,7 +19058,7 @@
TEST_DESCRIPTION(
"Test that an error is produced for a fragment shader which does not provide an output for one of the pipeline's color "
"attachments");
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Attachment 0 not written by fragment shader");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_WARNING_BIT_EXT, "Attachment 0 not written by fragment shader");
ASSERT_NO_FATAL_FAILURE(Init());
@@ -19183,7 +19183,7 @@
TEST_DESCRIPTION(
"Test that an error is produced for a mismatch between the fundamental type of an fragment shader output variable, and the "
"format of the corresponding attachment");
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "does not match fragment shader output type");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_WARNING_BIT_EXT, "does not match fragment shader output type");
ASSERT_NO_FATAL_FAILURE(Init());