diff options
| author | Chris Forbes <chrisf@ijw.co.nz> | 2015-05-04 14:04:24 +1200 |
|---|---|---|
| committer | Chris Forbes <chrisf@ijw.co.nz> | 2015-05-12 04:53:43 +1200 |
| commit | c353f05d730d64a43aaa227a5c995be2bb360e9d (patch) | |
| tree | 386dbaab09aba20e8e9dcaf590b8bddf5fc7e4ba | |
| parent | f5959dbbeaa036de11313c44545469eeada09b5c (diff) | |
| download | usermoji-c353f05d730d64a43aaa227a5c995be2bb360e9d.tar.xz | |
shader_checker: add type checking between VF and VS
| -rw-r--r-- | layers/shader_checker.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp index bb3b9225..a24eb957 100644 --- a/layers/shader_checker.cpp +++ b/layers/shader_checker.cpp @@ -33,6 +33,7 @@ #include "vkLayer.h" #include "layers_config.h" #include "layers_msg.h" +#include "vk_enum_string_helper.h" #include "shader_checker.h" // The following is #included again to catch certain OS-specific functions // being used: @@ -652,7 +653,18 @@ validate_vi_against_vs_inputs(VkPipelineVertexInputCreateInfo const *vi, shader_ it_b++; } else { - /* TODO: type check */ + unsigned attrib_type = get_format_type(it_a->second->format); + unsigned input_type = get_fundamental_type(vs, it_b->second.type_id); + + /* type checking */ + if (attrib_type != FORMAT_TYPE_UNDEFINED && input_type != FORMAT_TYPE_UNDEFINED && attrib_type != input_type) { + char vs_type[1024]; + describe_type(vs_type, vs, it_b->second.type_id); + sprintf(str, "Attribute type of `%s` at location %d does not match VS input type of `%s`", + string_VkFormat(it_a->second->format), a_first, vs_type); + layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, SHADER_CHECKER_INTERFACE_TYPE_MISMATCH, "SC", str); + } + /* OK! */ it_a++; it_b++; |
