hello-tool: add debug report stubs

This commit is contained in:
Danny Robson 2017-09-06 00:13:58 +10:00
parent 61becdad93
commit 4189cf6a66

View File

@ -14,7 +14,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if 0
static VkBool32 static VkBool32
vk_debug_callback (VkDebugReportFlagsEXT flags, vk_debug_callback (VkDebugReportFlagsEXT flags,
VkDebugReportObjectTypeEXT objType, VkDebugReportObjectTypeEXT objType,
@ -38,7 +37,6 @@ vk_debug_callback (VkDebugReportFlagsEXT flags,
return VK_FALSE; return VK_FALSE;
} }
#endif
VkShaderModule VkShaderModule
@ -93,6 +91,20 @@ main (void)
util::make_view (extensions.data (), extensions.data () + extensions.size ()) util::make_view (extensions.data (), extensions.data () + extensions.size ())
); );
{
VkDebugReportCallbackEXT callback;
VkDebugReportCallbackCreateInfoEXT debug_info {};
debug_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
debug_info.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
debug_info.pfnCallback = vk_debug_callback;
auto func = (decltype(&vkCreateDebugReportCallbackEXT))vkGetInstanceProcAddr (instance.id (),"vkCreateDebugReportCallbackEXT");
cruft::vk::error::try_code (
func (instance.id (), &debug_info, nullptr, &callback)
);
}
auto pdevices = cruft::vk::physical_device::find (instance); auto pdevices = cruft::vk::physical_device::find (instance);
auto &pdevice = pdevices[0]; auto &pdevice = pdevices[0];
@ -438,7 +450,7 @@ main (void)
std::vector<VkFramebuffer> swapchain_framebuffers (swap_image_views.size ()); std::vector<VkFramebuffer> swapchain_framebuffers (swap_image_views.size ());
for (int i = 0; i < swap_image_views.size (); ++i) { for (size_t i = 0; i < swap_image_views.size (); ++i) {
VkImageView attachments[] = { VkImageView attachments[] = {
swap_image_views[i] swap_image_views[i]
}; };
@ -476,7 +488,7 @@ main (void)
vkAllocateCommandBuffers (ldevice.id (), &alloc_info, command_buffers.data ()) vkAllocateCommandBuffers (ldevice.id (), &alloc_info, command_buffers.data ())
); );
for (int i = 0; i < command_buffers.size (); ++i) { for (size_t i = 0; i < command_buffers.size (); ++i) {
VkCommandBufferBeginInfo command_begin {}; VkCommandBufferBeginInfo command_begin {};
command_begin.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; command_begin.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
command_begin.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT; command_begin.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT;