Merge branch 'master' into slang_shaders
This commit is contained in:
commit
0d5becd8ea
3 changed files with 20 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Vulkan examples debug wrapper
|
* Vulkan examples debug wrapper
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
|
* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
|
||||||
*
|
*
|
||||||
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
||||||
*/
|
*/
|
||||||
|
|
@ -13,6 +13,8 @@ namespace vks
|
||||||
{
|
{
|
||||||
namespace debug
|
namespace debug
|
||||||
{
|
{
|
||||||
|
bool logToFile{ false };
|
||||||
|
|
||||||
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
|
PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT;
|
||||||
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
|
PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT;
|
||||||
VkDebugUtilsMessengerEXT debugUtilsMessenger;
|
VkDebugUtilsMessengerEXT debugUtilsMessenger;
|
||||||
|
|
@ -73,6 +75,12 @@ namespace vks
|
||||||
} else {
|
} else {
|
||||||
std::cout << debugMessage.str() << "\n\n";
|
std::cout << debugMessage.str() << "\n\n";
|
||||||
}
|
}
|
||||||
|
if (logToFile) {
|
||||||
|
std::ofstream logfile;
|
||||||
|
logfile.open("validation.txt", std::ios_base::app);
|
||||||
|
logfile << debugMessage.str() << std::endl;
|
||||||
|
logfile.close();
|
||||||
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Vulkan examples debug wrapper
|
* Vulkan examples debug wrapper
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
|
* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
|
||||||
*
|
*
|
||||||
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,6 +34,8 @@ namespace vks
|
||||||
{
|
{
|
||||||
namespace debug
|
namespace debug
|
||||||
{
|
{
|
||||||
|
extern bool logToFile;
|
||||||
|
|
||||||
// Default debug callback
|
// Default debug callback
|
||||||
VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsMessageCallback(
|
VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsMessageCallback(
|
||||||
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
||||||
|
|
|
||||||
|
|
@ -802,6 +802,7 @@ VulkanExampleBase::VulkanExampleBase()
|
||||||
// Command line arguments
|
// Command line arguments
|
||||||
commandLineParser.add("help", { "--help" }, 0, "Show help");
|
commandLineParser.add("help", { "--help" }, 0, "Show help");
|
||||||
commandLineParser.add("validation", { "-v", "--validation" }, 0, "Enable validation layers");
|
commandLineParser.add("validation", { "-v", "--validation" }, 0, "Enable validation layers");
|
||||||
|
commandLineParser.add("validationlog", { "-vl", "--validationlog" }, 0, "Log validation messages to a textfile (validation.txt)");
|
||||||
commandLineParser.add("vsync", { "-vs", "--vsync" }, 0, "Enable V-Sync");
|
commandLineParser.add("vsync", { "-vs", "--vsync" }, 0, "Enable V-Sync");
|
||||||
commandLineParser.add("fullscreen", { "-f", "--fullscreen" }, 0, "Start in fullscreen mode");
|
commandLineParser.add("fullscreen", { "-f", "--fullscreen" }, 0, "Start in fullscreen mode");
|
||||||
commandLineParser.add("width", { "-w", "--width" }, 1, "Set window width");
|
commandLineParser.add("width", { "-w", "--width" }, 1, "Set window width");
|
||||||
|
|
@ -830,6 +831,13 @@ VulkanExampleBase::VulkanExampleBase()
|
||||||
if (commandLineParser.isSet("validation")) {
|
if (commandLineParser.isSet("validation")) {
|
||||||
settings.validation = true;
|
settings.validation = true;
|
||||||
}
|
}
|
||||||
|
if (commandLineParser.isSet("validationlog")) {
|
||||||
|
vks::debug::logToFile = true;
|
||||||
|
std::ofstream logfile;
|
||||||
|
logfile.open("validation.txt", std::ios_base::app);
|
||||||
|
logfile << std::endl << "Sample: " << name << std::endl;
|
||||||
|
logfile.close();
|
||||||
|
}
|
||||||
if (commandLineParser.isSet("vsync")) {
|
if (commandLineParser.isSet("vsync")) {
|
||||||
settings.vsync = true;
|
settings.vsync = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue