aboutsummaryrefslogtreecommitdiff
path: root/demos/cube.c
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2016-03-25 14:25:16 -0600
committerKarl Schultz <karl@lunarg.com>2016-03-25 14:25:16 -0600
commitcd9887df6a1dcc03280306fcbea241bb92ddb0cd (patch)
tree6a6690c644652b268667884e16f567499d0f9d10 /demos/cube.c
parentb219adcede7e27d1e248dc5313bad00e8b418777 (diff)
downloadusermoji-cd9887df6a1dcc03280306fcbea241bb92ddb0cd.tar.xz
demos: Implement --break for cube and tri.
This argument makes the program stop in the debugger on a validation error. Only makes sense to use it with --validate.
Diffstat (limited to 'demos/cube.c')
-rw-r--r--demos/cube.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/demos/cube.c b/demos/cube.c
index f0257ad1..e6d66bd9 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -2283,20 +2283,17 @@ static void demo_init_vk(struct demo *demo) {
.enabledExtensionCount = enabled_extension_count,
.ppEnabledExtensionNames = (const char *const *)extension_names,
};
+
+ /*
+ * This is info for a temp callback to use during CreateInstance.
+ * After the instance is created, we use the instance-based
+ * function to register the final callback.
+ */
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.pfnCallback = demo->use_break ? BreakCallback : dbgFunc;
dbgCreateInfo.pUserData = NULL;
dbgCreateInfo.flags =
VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
@@ -2440,17 +2437,9 @@ static void demo_init_vk(struct demo *demo) {
"vkGetProcAddr Failure");
}
- PFN_vkDebugReportCallbackEXT callback;
-
- 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
- }
VkDebugReportCallbackCreateInfoEXT dbgCreateInfo;
+ PFN_vkDebugReportCallbackEXT callback;
+ callback = demo->use_break ? BreakCallback : dbgFunc;
dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
dbgCreateInfo.pNext = NULL;
dbgCreateInfo.pfnCallback = callback;