aboutsummaryrefslogtreecommitdiff
path: root/layers/shader_checker.cpp
diff options
context:
space:
mode:
authorDavid Pinedo <david@lunarg.com>2015-04-27 13:20:08 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-29 11:25:22 -0600
commit586bbe3500b36a34df03760bc7aa149184ad4ede (patch)
tree9803c0726c16ffdc0acca00e805c621c49f3cb2d /layers/shader_checker.cpp
parentdf8f1ec0507897fe34ea79abf1bf8b7c9e1bf44c (diff)
downloadusermoji-586bbe3500b36a34df03760bc7aa149184ad4ede.tar.xz
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.
Diffstat (limited to 'layers/shader_checker.cpp')
-rw-r--r--layers/shader_checker.cpp2
1 files changed, 1 insertions, 1 deletions
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);