VK_DBG_LAYER_ACTION_IGNORE = 0x0,
VK_DBG_LAYER_ACTION_CALLBACK = 0x1,
VK_DBG_LAYER_ACTION_LOG_MSG = 0x2,
- VK_DBG_LAYER_ACTION_BREAK = 0x4
+ VK_DBG_LAYER_ACTION_BREAK = 0x4,
+ VK_DBG_LAYER_ACTION_DEBUG_OUTPUT = 0x8,
} VkLayerDbgAction;
// ------------------------------------------------------------------------------------------------
return VK_DBG_LAYER_ACTION_IGNORE;
else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_LOG_MSG"))
return VK_DBG_LAYER_ACTION_LOG_MSG;
+#ifdef WIN32
+ else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT"))
+ return VK_DBG_LAYER_ACTION_DEBUG_OUTPUT;
+#endif
else if (!strcmp(_enum, "VK_DBG_LAYER_ACTION_BREAK"))
return VK_DBG_LAYER_ACTION_BREAK;
return (VkLayerDbgAction) 0;
return false;
}
+
+static inline VkBool32 VKAPI win32_debug_output_msg(
+ VkFlags msgFlags,
+ VkDbgObjectType objType,
+ uint64_t srcObject,
+ size_t location,
+ int32_t msgCode,
+ const char* pLayerPrefix,
+ const char* pMsg,
+ void* pUserData)
+{
+#ifdef WIN32
+ char msg_flags[30];
+ char buf[2048];
+
+ print_msg_flags(msgFlags, msg_flags);
+ _snprintf(buf, sizeof(buf)-1, "%s (%s): object: 0x%" PRIxLEAST64 " type: %d location: %zu msgCode: %d: %s\n",
+ pLayerPrefix, msg_flags, srcObject, objType, location, msgCode, pMsg);
+
+ OutputDebugString(buf);
+#endif
+
+ return false;
+}
+
#endif // LAYER_LOGGING_H