From 586bbe3500b36a34df03760bc7aa149184ad4ede Mon Sep 17 00:00:00 2001 From: David Pinedo Date: Mon, 27 Apr 2015 13:20:08 -0600 Subject: Shader Checker Layer: make sure iterated list is of non-zero length On MSVC++, need a check to make sure a list is of non-zero length before attempting to iterate on it. --- layers/shader_checker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layers/shader_checker.cpp') diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp index 28e0fddc..3d01b2f1 100644 --- a/layers/shader_checker.cpp +++ b/layers/shader_checker.cpp @@ -661,7 +661,7 @@ validate_fs_outputs_against_cb(shader_source const *fs, VkPipelineCbStateCreateI * are currently dense, but the parallel with matching between shader stages is nice. */ - while (it != outputs.end() || attachment < cb->attachmentCount) { + while (outputs.size() > 0 && (it != outputs.end() || attachment < cb->attachmentCount)) { if (attachment == cb->attachmentCount || it->first < attachment) { sprintf(str, "FS writes to output location %d with no matching attachment", it->first); layerCbMsg(VK_DBG_MSG_WARNING, VK_VALIDATION_LEVEL_0, NULL, 0, SHADER_CHECKER_OUTPUT_NOT_CONSUMED, "SC", str); -- cgit v1.2.3