layers: LX255, Print readable version of VkAccessFlags
Also update related validation messages to indicate src/dest accessMask
diff --git a/layers/vk_layer_utils.cpp b/layers/vk_layer_utils.cpp
index a96c97e..568d3b0 100644
--- a/layers/vk_layer_utils.cpp
+++ b/layers/vk_layer_utils.cpp
@@ -25,8 +25,10 @@
*/
#include <string.h>
+#include <string>
#include "vulkan/vulkan.h"
#include "vk_layer_utils.h"
+#include "vk_enum_string_helper.h"
typedef struct _VULKAN_FORMAT_INFO {
size_t size;
@@ -575,3 +577,24 @@
{
return vk_format_table[format].channel_count;
}
+
+// Print readable FlagBits in FlagMask
+std::string string_VkAccessFlags(VkAccessFlags accessMask)
+{
+ std::string result;
+ std::string separator;
+
+ if (accessMask == 0) {
+ result = "[None]";
+ } else {
+ result = "[";
+ for (auto i = 0; i < 32; i++) {
+ if (accessMask & (1 << i)) {
+ result = result + separator + string_VkAccessFlagBits((VkAccessFlagBits)(1 << i));
+ separator = " | ";
+ }
+ }
+ result = result + "]";
+ }
+ return result;
+}