aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layers/core_validation.cpp12
-rw-r--r--layers/core_validation_error_enums.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 80e05490..3cda6489 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2801,8 +2801,16 @@ static bool validate_pipeline_shader_stage(debug_report_data *report_data,
pass = false;
}
}
-
- /* TODO: type match, etc */
+ else if (get_format_type(rpci->pAttachments[index].format) !=
+ get_fundamental_type(module, use.second.type_id)) {
+ if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
+ SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH, "SC",
+ "Subpass input attachment %u format of %s does not match type used in shader `%s`",
+ use.first, string_VkFormat(rpci->pAttachments[index].format),
+ describe_type(module, use.second.type_id).c_str())) {
+ pass = false;
+ }
+ }
}
}
diff --git a/layers/core_validation_error_enums.h b/layers/core_validation_error_enums.h
index 2ee0420c..a10c6ac3 100644
--- a/layers/core_validation_error_enums.h
+++ b/layers/core_validation_error_enums.h
@@ -244,6 +244,7 @@ enum SHADER_CHECKER_ERROR {
SHADER_CHECKER_FEATURE_NOT_ENABLED, // Shader uses capability requiring a feature not enabled on device
SHADER_CHECKER_BAD_CAPABILITY, // Shader uses capability not supported by Vulkan (OpenCL features)
SHADER_CHECKER_MISSING_INPUT_ATTACHMENT, // Shader uses an input attachment but not declared in subpass
+ SHADER_CHECKER_INPUT_ATTACHMENT_TYPE_MISMATCH, // Shader input attachment type does not match subpass format
};
// Device Limits ERROR codes