aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Schultz <karl@lunarg.com>2016-03-22 17:06:13 -0600
committerKarl Schultz <karl@lunarg.com>2016-03-22 17:06:13 -0600
commit0218c000b4641d9f26de8cdf89ed4ac6f212bdac (patch)
tree3d3f192685bdd4dfea196e6a50d15162523d7c23
parent6af02ebe6631eaebaef3928da8fb49cf61c3095f (diff)
downloadusermoji-0218c000b4641d9f26de8cdf89ed4ac6f212bdac.tar.xz
demos: cube exit status reflects validation status
Normal exit code is 0, but exit with code 1 if validation fails. Change-Id: Ic8bb960b09e1b9f3274188eb4a30151ae6f3d0a0
-rw-r--r--demos/cube.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/demos/cube.c b/demos/cube.c
index c4bcd2f2..5477beee 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -117,6 +117,8 @@ struct texture_object {
static char *tex_files[] = {"lunarg.ppm"};
+static int validation_error = 0;
+
struct vkcube_vs_uniform {
// Must start with MVP
float mvp[4][4];
@@ -268,6 +270,7 @@ dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType,
if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
sprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode,
pMsg);
+ validation_error = 1;
} else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) {
// We know that we're submitting queues without fences, ignore this
// warning
@@ -277,7 +280,9 @@ dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType,
}
sprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode,
pMsg);
+ validation_error = 1;
} else {
+ validation_error = 1;
return false;
}
@@ -1917,7 +1922,7 @@ static void demo_run(struct demo *demo) {
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg) {
case WM_CLOSE:
- PostQuitMessage(0);
+ PostQuitMessage(validation_error);
break;
case WM_PAINT:
demo_run(&demo);
@@ -2803,6 +2808,6 @@ int main(int argc, char **argv) {
demo_cleanup(&demo);
- return 0;
+ return validation_error;
}
#endif // _WIN32