@@ -802,6 +802,7 @@ VulkanExampleBase::VulkanExampleBase()
802802 // Command line arguments
803803 commandLineParser.add (" help" , { " --help" }, 0 , " Show help" );
804804 commandLineParser.add (" validation" , { " -v" , " --validation" }, 0 , " Enable validation layers" );
805+ commandLineParser.add (" validationlog" , { " -vl" , " --validationlog" }, 0 , " Log validation messages to a textfile (validation.txt)" );
805806 commandLineParser.add (" vsync" , { " -vs" , " --vsync" }, 0 , " Enable V-Sync" );
806807 commandLineParser.add (" fullscreen" , { " -f" , " --fullscreen" }, 0 , " Start in fullscreen mode" );
807808 commandLineParser.add (" width" , { " -w" , " --width" }, 1 , " Set window width" );
@@ -830,6 +831,13 @@ VulkanExampleBase::VulkanExampleBase()
830831 if (commandLineParser.isSet (" validation" )) {
831832 settings.validation = true ;
832833 }
834+ if (commandLineParser.isSet (" validationlog" )) {
835+ vks::debug::logToFile = true ;
836+ std::ofstream logfile;
837+ logfile.open (" validation.txt" , std::ios_base::app);
838+ logfile << std::endl << " Sample: " << name << std::endl;
839+ logfile.close ();
840+ }
833841 if (commandLineParser.isSet (" vsync" )) {
834842 settings.vsync = true ;
835843 }
0 commit comments