Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept KHRONOS validation if LUNARG validation is not available. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,25 @@ class ComputeApplication {
/*
And then we simply check if VK_LAYER_LUNARG_standard_validation is among the supported layers.
*/
bool foundLayer = false;
bool foundLayer0 = false;
bool foundLayer1 = false;
for (VkLayerProperties prop : layerProperties) {

if (strcmp("VK_LAYER_LUNARG_standard_validation", prop.layerName) == 0) {
foundLayer = true;
foundLayer0 = true;
break;
}
if (strcmp("VK_LAYER_KHRONOS_validation", prop.layerName) == 0) {
foundLayer1 = true;
break;
}

}

if (!foundLayer) {
if (foundLayer0)
enabledLayers.push_back("VK_LAYER_LUNARG_standard_validation");
else if (foundLayer1)
enabledLayers.push_back("VK_LAYER_KHRONOS_validation");
else
throw std::runtime_error("Layer VK_LAYER_LUNARG_standard_validation not supported\n");
}
enabledLayers.push_back("VK_LAYER_LUNARG_standard_validation"); // Alright, we can use this layer.

/*
We need to enable an extension named VK_EXT_DEBUG_REPORT_EXTENSION_NAME,
Expand Down