aboutsummaryrefslogtreecommitdiff
path: root/layers/shader_checker.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2015-05-25 11:13:24 +1200
committerChris Forbes <chrisf@ijw.co.nz>2015-06-04 10:20:02 +1200
commit610fc3d7c6c9d48b20fd05550a0491ff5b953b29 (patch)
tree8ea2261a0dcb1fbf428d4d5f725ed846dbbd3701 /layers/shader_checker.cpp
parentce540152b969340f8f73003f837c294ac2dd5527 (diff)
downloadusermoji-610fc3d7c6c9d48b20fd05550a0491ff5b953b29.tar.xz
shader_checker: validate VS inputs against VI even when no VI
Now we'll treat the lack of a VI stage as the same as a VI stage which provides no attribs and no bindings. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Tobin Ehlis <tobin@lunarg.com>
Diffstat (limited to 'layers/shader_checker.cpp')
-rw-r--r--layers/shader_checker.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index 31213498..aba30ecc 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -645,8 +645,10 @@ validate_vi_against_vs_inputs(VkPipelineVertexInputCreateInfo const *vi, shader_
/* Build index by location */
std::map<uint32_t, VkVertexInputAttributeDescription const *> attribs;
- for (unsigned i = 0; i < vi->attributeCount; i++)
- attribs[vi->pVertexAttributeDescriptions[i].location] = &vi->pVertexAttributeDescriptions[i];
+ if (vi) {
+ for (unsigned i = 0; i < vi->attributeCount; i++)
+ attribs[vi->pVertexAttributeDescriptions[i].location] = &vi->pVertexAttributeDescriptions[i];
+ }
auto it_a = attribs.begin();
auto it_b = inputs.begin();
@@ -812,7 +814,7 @@ VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(VkDevice device,
sprintf(str, "Pipeline: vi=%p vs=%p fs=%p cb=%p\n", vi, vs_source, fs_source, cb);
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, SHADER_CHECKER_NONE, "SC", str);
- if (vi && vs_source) {
+ if (vs_source) {
pass = validate_vi_against_vs_inputs(vi, vs_source) && pass;
}