Skip to content
Snippets Groups Projects
Verified Commit 898eb191 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#7] fixed cross-compatible debug-flags

parent 80ff3da6
No related branches found
No related tags found
1 merge request!2Resolve "Context Functionality"
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -28,7 +28,7 @@ namespace vkcv { ...@@ -28,7 +28,7 @@ namespace vkcv {
} }
// if in debug mode, check if validation layers are supported. Enable them if supported // if in debug mode, check if validation layers are supported. Enable them if supported
#if _DEBUG #ifndef NDEBUG
std::vector<const char*> validationLayers = { std::vector<const char*> validationLayers = {
"VK_LAYER_KHRONOS_validation" "VK_LAYER_KHRONOS_validation"
}; };
...@@ -73,7 +73,7 @@ namespace vkcv { ...@@ -73,7 +73,7 @@ namespace vkcv {
instanceExtensions.data() instanceExtensions.data()
); );
#if _DEBUG #ifndef NDEBUG
instanceCreateInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size()); instanceCreateInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size());
instanceCreateInfo.ppEnabledLayerNames = validationLayers.data(); instanceCreateInfo.ppEnabledLayerNames = validationLayers.data();
#endif #endif
...@@ -111,7 +111,7 @@ namespace vkcv { ...@@ -111,7 +111,7 @@ namespace vkcv {
nullptr // Should our device use some features??? If yes: TODO nullptr // Should our device use some features??? If yes: TODO
); );
#if _DEBUG #ifndef NDEBUG
deviceCreateInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size()); deviceCreateInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size());
deviceCreateInfo.ppEnabledLayerNames = validationLayers.data(); deviceCreateInfo.ppEnabledLayerNames = validationLayers.data();
#endif #endif
...@@ -273,7 +273,7 @@ namespace vkcv { ...@@ -273,7 +273,7 @@ namespace vkcv {
const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount); const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);
std::vector<const char*> extensions(glfwExtensions, glfwExtensions + glfwExtensionCount); std::vector<const char*> extensions(glfwExtensions, glfwExtensions + glfwExtensionCount);
#if _DEBUG #ifndef NDEBUG
extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment