Flutter Engine
vulkan::VulkanDebugReport Class Reference

#include <vulkan_debug_report.h>

Public Member Functions

 VulkanDebugReport (const VulkanProcTable &vk, const VulkanHandle< VkInstance > &application)
 
 ~VulkanDebugReport ()
 
bool IsValid () const
 

Static Public Member Functions

static std::string DebugExtensionName ()
 

Detailed Description

Definition at line 15 of file vulkan_debug_report.h.

Constructor & Destructor Documentation

◆ VulkanDebugReport()

vulkan::VulkanDebugReport::VulkanDebugReport ( const VulkanProcTable vk,
const VulkanHandle< VkInstance > &  application 
)

Definition at line 181 of file vulkan_debug_report.cc.

References flags, vulkan::OnVulkanDebugReportCallback(), vulkan::ValidationLayerInfoMessagesEnabled(), VK_CALL_LOG_ERROR, and ~VulkanDebugReport().

184  : vk(p_vk), application_(application), valid_(false) {
185  if (!vk.CreateDebugReportCallbackEXT || !vk.DestroyDebugReportCallbackEXT) {
186  return;
187  }
188 
189  if (!application_) {
190  return;
191  }
192 
193  VkDebugReportFlagsEXT flags = kVulkanErrorFlags;
195  flags |= kVulkanInfoFlags;
196  }
197  const VkDebugReportCallbackCreateInfoEXT create_info = {
198  .sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT,
199  .pNext = nullptr,
200  .flags = flags,
201  .pfnCallback = &vulkan::OnVulkanDebugReportCallback,
202  .pUserData = nullptr,
203  };
204 
205  VkDebugReportCallbackEXT handle = VK_NULL_HANDLE;
206  if (VK_CALL_LOG_ERROR(vk.CreateDebugReportCallbackEXT(
207  application_, &create_info, nullptr, &handle)) != VK_SUCCESS) {
208  return;
209  }
210 
211  handle_ = {handle, [this](VkDebugReportCallbackEXT handle) {
212  vk.DestroyDebugReportCallbackEXT(application_, handle, nullptr);
213  }};
214 
215  valid_ = true;
216 }
FlutterSemanticsFlag flags
bool ValidationLayerInfoMessagesEnabled()
#define VK_CALL_LOG_ERROR(expression)
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)

◆ ~VulkanDebugReport()

vulkan::VulkanDebugReport::~VulkanDebugReport ( )
default

Referenced by VulkanDebugReport().

Member Function Documentation

◆ DebugExtensionName()

std::string vulkan::VulkanDebugReport::DebugExtensionName ( )
static

Definition at line 22 of file vulkan_debug_report.cc.

Referenced by vulkan::VulkanApplication::VulkanApplication().

22  {
23  return VK_EXT_DEBUG_REPORT_EXTENSION_NAME;
24 }

◆ IsValid()

bool vulkan::VulkanDebugReport::IsValid ( ) const

Definition at line 220 of file vulkan_debug_report.cc.

220  {
221  return valid_;
222 }

The documentation for this class was generated from the following files: