11#include "flutter/fml/compiler_specific.h"
33 return "Performance Warning";
50 return "Physical Device";
58 return "Command Buffer";
62 return "Device Memory";
76 return "Shader Module";
78 return "Pipeline Cache";
80 return "Pipeline Layout";
86 return "Descriptor Set Layout";
90 return "Descriptor Pool";
92 return "Descriptor Set";
96 return "Command Pool";
118 int32_t message_code,
119 const char* layer_prefix,
122 std::vector<std::pair<std::string, std::string>> items;
126 items.emplace_back(
"Object Type",
135 if (message_code != 0) {
139 if (layer_prefix !=
nullptr) {
140 items.emplace_back(
"Layer", layer_prefix);
144 items.emplace_back(
"Message",
message);
149 for (
const auto& item : items) {
150 padding =
std::max(padding, item.first.size());
159 stream <<
"--- Vulkan Debug Report ----------------------------------------";
163 for (
const auto& item : items) {
164 stream <<
"| " << std::setw(
static_cast<int>(padding)) << item.first
165 << std::setw(0) <<
": " << item.second << std::endl;
168 stream <<
"-----------------------------------------------------------------";
170 if (
flags & kVulkanErrorFlags) {
188 : vk_(p_vk), application_(application), valid_(
false) {
189 if (!vk_.CreateDebugReportCallbackEXT || !vk_.DestroyDebugReportCallbackEXT) {
199 flags |= kVulkanInfoFlags;
206 .pUserData =
nullptr,
211 application_, &create_info,
nullptr, &handle)) !=
VK_SUCCESS) {
216 handle, [
this](VkDebugReportCallbackEXT handle) {
217 vk_.DestroyDebugReportCallbackEXT(application_, handle,
nullptr);
VulkanDebugReport(const VulkanProcTable &vk, const VulkanHandle< VkInstance > &application)
static std::string DebugExtensionName()
FlutterSemanticsFlag flags
#define FML_LOG(severity)
#define FML_DCHECK(condition)
static float max(float r, float g, float b)
bool ValidationErrorsFatal()
static const char * VkDebugReportFlagsEXTToString(VkDebugReportFlagsEXT flags)
static VKAPI_ATTR VkBool32 OnVulkanDebugReportCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT object_type, uint64_t object, size_t location, int32_t message_code, const char *layer_prefix, const char *message, void *user_data)
static const VkDebugReportFlagsEXT kVulkanErrorFlags FML_ALLOW_UNUSED_TYPE
static const char * VkDebugReportObjectTypeEXTToString(VkDebugReportObjectTypeEXT type)
bool ValidationLayerInfoMessagesEnabled()
static SkString to_string(int n)
@ VK_DEBUG_REPORT_INFORMATION_BIT_EXT
@ VK_DEBUG_REPORT_WARNING_BIT_EXT
@ VK_DEBUG_REPORT_DEBUG_BIT_EXT
@ VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT
@ VK_DEBUG_REPORT_ERROR_BIT_EXT
VkDebugReportObjectTypeEXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT
@ VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT
#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME
VkFlags VkDebugReportFlagsEXT
@ VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT
#define VK_CALL_LOG_ERROR(expression)