From 610fc3d7c6c9d48b20fd05550a0491ff5b953b29 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 25 May 2015 11:13:24 +1200 Subject: 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 Reviewed-by: Tobin Ehlis --- layers/shader_checker.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'layers/shader_checker.cpp') 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 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; } -- cgit v1.2.3