summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-03-14 11:29:01 -0600
committerTobin Ehlis <tobine@google.com>2017-03-15 06:57:27 -0600
commit08613200034f5a9e98438c30dc10f466d3a0c447 (patch)
treeafb74601463df5c049397d1fd587c8ba3cc8e2e8 /demos
parent7a7c05af97a73fc6d4917ddda909f119583ff9fc (diff)
demos:Add cube option --validate-checks-disabled
Added option to cube demo "--validate-checks-disabled". This option will use the VK_EXT_validation_flags extension to cause validation to skip all validation flags that have a flag. This is meant to provide a basic test for the VK_EXT_validation_flags extension and find any obvious bugs/crashes.
Diffstat (limited to 'demos')
-rw-r--r--demos/cube.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/demos/cube.c b/demos/cube.c
index 70fd9d5a..2d87073d 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -391,6 +391,7 @@ struct demo {
int32_t curFrame;
int32_t frameCount;
bool validate;
+ bool validate_checks_disabled;
bool use_break;
bool suppress_popups;
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback;
@@ -2932,6 +2933,7 @@ static void demo_init_vk(struct demo *demo) {
* function to register the final callback.
*/
VkDebugReportCallbackCreateInfoEXT dbgCreateInfoTemp;
+ VkValidationFlagsEXT val_flags;
if (demo->validate) {
dbgCreateInfoTemp.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
dbgCreateInfoTemp.pNext = NULL;
@@ -2939,6 +2941,14 @@ static void demo_init_vk(struct demo *demo) {
dbgCreateInfoTemp.pUserData = demo;
dbgCreateInfoTemp.flags =
VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
+ if (demo->validate_checks_disabled) {
+ val_flags.sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT;
+ val_flags.pNext = NULL;
+ val_flags.disabledValidationCheckCount = 1;
+ VkValidationCheckEXT disabled_check = VK_VALIDATION_CHECK_ALL_EXT;
+ val_flags.pDisabledValidationChecks = &disabled_check;
+ dbgCreateInfoTemp.pNext = (void*)&val_flags;
+ }
inst_info.pNext = &dbgCreateInfoTemp;
}
@@ -3423,6 +3433,11 @@ static void demo_init(struct demo *demo, int argc, char **argv) {
demo->validate = true;
continue;
}
+ if (strcmp(argv[i], "--validate-checks-disabled") == 0) {
+ demo->validate = true;
+ demo->validate_checks_disabled = true;
+ continue;
+ }
if (strcmp(argv[i], "--xlib") == 0) {
fprintf(stderr, "--xlib is deprecated and no longer does anything");
continue;
@@ -3441,7 +3456,7 @@ static void demo_init(struct demo *demo, int argc, char **argv) {
#if defined(ANDROID)
ERR_EXIT("Usage: cube [--validate]\n", "Usage");
#else
- fprintf(stderr, "Usage:\n %s [--use_staging] [--validate] [--break] "
+ fprintf(stderr, "Usage:\n %s [--use_staging] [--validate] [--validate-checks-disabled] [--break] "
"[--c <framecount>] [--suppress_popups] [--present_mode <present mode enum>]\n"
"VK_PRESENT_MODE_IMMEDIATE_KHR = %d\n"
"VK_PRESENT_MODE_MAILBOX_KHR = %d\n"