19 vk::DebugUtilsMessengerCreateInfoEXT messenger_info;
20 messenger_info.messageSeverity =
21 vk::DebugUtilsMessageSeverityFlagBitsEXT::eWarning |
22 vk::DebugUtilsMessageSeverityFlagBitsEXT::eError;
23 messenger_info.messageType =
24 vk::DebugUtilsMessageTypeFlagBitsEXT::eGeneral |
25 vk::DebugUtilsMessageTypeFlagBitsEXT::ePerformance |
26 vk::DebugUtilsMessageTypeFlagBitsEXT::eValidation;
27 messenger_info.pUserData =
this;
28 messenger_info.pfnUserCallback = DebugUtilsMessengerCallback;
30 auto messenger =
instance.createDebugUtilsMessengerEXTUnique(messenger_info);
32 if (messenger.result != vk::Result::eSuccess) {
38 messenger_ = std::move(messenger.value);
51 for (
size_t i = 0u;
i <
count;
i++) {
64 for (
size_t i = 0u;
i <
count;
i++) {
66 <<
names[
i].objectHandle <<
"] [";
67 if (
names[
i].pObjectName !=
nullptr) {
88 static_cast<vk::DebugUtilsMessageSeverityFlagBitsEXT
>(
90 static_cast<vk::DebugUtilsMessageTypeFlagsEXT
>(
type),
94 case Result::kContinue:
102DebugReportVK::Result DebugReportVK::OnDebugCallback(
103 vk::DebugUtilsMessageSeverityFlagBitsEXT severity,
104 vk::DebugUtilsMessageTypeFlagsEXT
type,
110 if (
data->messageIdNumber == 0x2c36905d) {
111 return Result::kContinue;
117 if (
data->messageIdNumber == 0x609A13B) {
118 return Result::kContinue;
121 if (
data->pMessageIdName !=
nullptr &&
122 strcmp(
data->pMessageIdName,
123 "VUID-VkShaderModuleCreateInfo-pCode-08737") == 0) {
124 return Result::kContinue;
128 if (
data->pMessageIdName !=
nullptr &&
130 data->pMessageIdName,
131 "VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849") ==
133 return Result::kContinue;
136 std::vector<std::pair<std::string, std::string>> items;
142 if (
data->pMessageIdName) {
143 items.emplace_back(
"ID Name",
data->pMessageIdName);
150 items.emplace_back(
"Queue Breadcrumbs", std::move(queues));
152 items.emplace_back(
"Queue Breadcrumbs",
"[NONE]");
157 items.emplace_back(
"CMD Buffer Breadcrumbs", std::move(cmd_bufs));
159 items.emplace_back(
"CMD Buffer Breadcrumbs",
"[NONE]");
165 items.emplace_back(
"Related Objects", std::move(related));
168 if (
data->pMessage) {
169 items.emplace_back(
"Trigger",
data->pMessage);
174 for (
const auto& item : items) {
175 padding =
std::max(padding, item.first.size());
184 stream <<
"--- Vulkan Debug Report ----------------------------------------";
188 for (
const auto& item : items) {
189 stream <<
"| " << std::setw(
static_cast<int>(padding)) << item.first
190 << std::setw(0) <<
": " << item.second << std::endl;
193 stream <<
"-----------------------------------------------------------------";
195 if (
type == vk::DebugUtilsMessageTypeFlagBitsEXT::ePerformance) {
201 return Result::kContinue;
The Vulkan layers and extensions wrangler.
bool AreValidationsEnabled() const
DebugReportVK(const CapabilitiesVK &caps, const vk::Instance &instance)
#define FML_LOG(severity)
static float max(float r, float g, float b)
const Type & ObjectType()
static const char *const names[]
static std::string JoinVKDebugUtilsObjectNameInfoEXT(const VkDebugUtilsObjectNameInfoEXT *names, size_t count)
static std::string JoinLabels(const VkDebugUtilsLabelEXT *labels, size_t count)
static SkString to_string(int n)
std::shared_ptr< const fml::Mapping > data
VkFlags VkDebugUtilsMessageTypeFlagsEXT
VkDebugUtilsMessageSeverityFlagBitsEXT