layers: Add bailout flag to debug report callback
Layer validation tests will deliberately induce
errors that the validation layer should catch.
In these cases we don't really want the layer to call
down the chain once it's detected a failure. We can't
know that in the layer so changing the return value
on the callback from void to VkBool32 so that the
callback can indicate if the call should continue
or not. true = bail.
That allows the call chain to execute normally,
not segfault in the driver and allow the test
to clean things up.
diff --git a/demos/tri.c b/demos/tri.c
index 30f95c9..3b2eada 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -107,7 +107,7 @@
int32_t tex_width, tex_height;
};
-void dbgFunc(
+VkBool32 dbgFunc(
VkFlags msgFlags,
VkDbgObjectType objType,
uint64_t srcObject,
@@ -126,7 +126,7 @@
} else if (msgFlags & VK_DBG_REPORT_WARN_BIT) {
sprintf(message,"WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
} else {
- return;
+ return false;
}
#ifdef _WIN32
@@ -136,6 +136,7 @@
fflush(stdout);
#endif
free(message);
+ return true;
}
typedef struct _SwapchainBuffers {