layers: Add warning for LOAD_OP_LOAD+LAYOUT_UNDEFINED
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 04:16:32 +0000 (20:16 -0800)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 5 Dec 2017 20:55:16 +0000 (13:55 -0700)
commit57fb625663db6fe1d11c6fa0f6047b29695aac78
treefeae8800ae7b19adfea8d31a55d85d44bf287b94
parent4449a761d5dba8a95c536777f6c09be2bc01657e
layers: Add warning for LOAD_OP_LOAD+LAYOUT_UNDEFINED

While not technically an error (VK_IMAGE_LAYOUT_UNDEFINED is always
allowed as an initial layout), this combination is almost never what
you actually want.  If nothing else, it's a potential performance
problem because VK_ATTACHMENT_LOAD_OP_LOAD is liable to be more
expensive than VK_ATTACHMENT_LOAD_OP_DONT_CARE.  Give developers a
helpful warning in this case.

This would have caught an actual bug in some of the Sascha Willems
demos as fixed in this PR:

https://github.com/SaschaWillems/Vulkan/pull/400

Change-Id: I73c64ae60a65cfb200db00707d650ec8da7ba130
layers/buffer_validation.cpp