aboutsummaryrefslogtreecommitdiff
path: root/layers/shader_checker.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2015-05-04 14:20:10 +1200
committerChris Forbes <chrisf@ijw.co.nz>2015-05-12 04:53:45 +1200
commit4edb1b973e2b35c5fce863cebafcbaf40474e29d (patch)
tree6b2a80a46cdd9b3cac8c45ad1ed56dc76ca9416c /layers/shader_checker.cpp
parentc353f05d730d64a43aaa227a5c995be2bb360e9d (diff)
downloadusermoji-4edb1b973e2b35c5fce863cebafcbaf40474e29d.tar.xz
shader_checker: check types between FS output and CB
Diffstat (limited to 'layers/shader_checker.cpp')
-rw-r--r--layers/shader_checker.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index a24eb957..8e08b372 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -726,8 +726,19 @@ validate_fs_outputs_against_cb(shader_source const *fs, VkPipelineCbStateCreateI
attachment++;
}
else {
+ unsigned output_type = get_fundamental_type(fs, it->second.type_id);
+ unsigned att_type = get_format_type(cb->pAttachments[attachment].format);
+
+ /* type checking */
+ if (att_type != FORMAT_TYPE_UNDEFINED && output_type != FORMAT_TYPE_UNDEFINED && att_type != output_type) {
+ char fs_type[1024];
+ describe_type(fs_type, fs, it->second.type_id);
+ sprintf(str, "Attachment %d of type `%s` does not match FS output type of `%s`",
+ attachment, string_VkFormat(cb->pAttachments[attachment].format), fs_type);
+ layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", str);
+ }
+
/* OK! */
- /* TODO: typecheck */
it++;
attachment++;
}