From 5959bbdaa3cf0a28fc0e8efa0411e9c10a680b62 Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Fri, 25 Mar 2016 09:07:19 -0600 Subject: [PATCH] cube: Call vkCreateInstance so that it sets up a temporary callback. --- demos/cube.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/demos/cube.c b/demos/cube.c index 0e87aed..f0257ad 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -2283,6 +2283,25 @@ static void demo_init_vk(struct demo *demo) { .enabledExtensionCount = enabled_extension_count, .ppEnabledExtensionNames = (const char *const *)extension_names, }; + VkDebugReportCallbackCreateInfoEXT dbgCreateInfo; + PFN_vkDebugReportCallbackEXT callback; + if (demo->validate) { + if (!demo->use_break) { + callback = dbgFunc; + } else { + callback = dbgFunc; + // TODO add a break callback defined locally since there is no + // longer + // one included in the loader + } + dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; + dbgCreateInfo.pNext = NULL; + dbgCreateInfo.pfnCallback = callback; + dbgCreateInfo.pUserData = NULL; + dbgCreateInfo.flags = + VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT; + inst_info.pNext = &dbgCreateInfo; + } uint32_t gpu_count; -- 2.7.4