Use explicit validation layer names on Android (no meta layer available)

This commit is contained in:
saschawillems 2017-03-13 19:24:07 +01:00
parent 418f4e2875
commit 2accf02c1e
2 changed files with 19 additions and 8 deletions

View file

@ -15,14 +15,25 @@ namespace vks
{
namespace debug
{
int validationLayerCount = 1;
const char *validationLayerNames[] =
{
// This is a meta layer that enables all of the standard
// validation layers in the correct order :
// threading, parameter_validation, device_limits, object_tracker, image, core_validation, swapchain, and unique_objects
#if !defined(__ANDROID__)
// On desktop the LunarG loaders exposes a meta layer that contains all layers
int32_t validationLayerCount = 1;
const char *validationLayerNames[] = {
"VK_LAYER_LUNARG_standard_validation"
};
#else
// On Android we need to explicitly select all layers
int32_t validationLayerCount = 7;
const char *validationLayerNames[] = {
"VK_LAYER_GOOGLE_threading",
"VK_LAYER_LUNARG_parameter_validation",
"VK_LAYER_LUNARG_object_tracker",
"VK_LAYER_LUNARG_core_validation",
"VK_LAYER_LUNARG_image",
"VK_LAYER_LUNARG_swapchain",
"VK_LAYER_GOOGLE_unique_objects"
};
#endif
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback = VK_NULL_HANDLE;
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallback = VK_NULL_HANDLE;
@ -75,7 +86,7 @@ namespace vks
std::stringstream debugMessage;
debugMessage << prefix << " [" << pLayerPrefix << "] Code " << msgCode << " : " << pMsg;
#if defined(ANDROID)
#if defined(__ANDROID__)
if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
LOGE("%s", debugMessage.str().c_str());
}

View file

@ -754,7 +754,7 @@ void VulkanExampleBase::initVulkan()
{
// The report flags determine what type of messages for the layers will be displayed
// For validating (debugging) an appplication the error and warning bits should suffice
VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
// Additional flags include performance info, loader and layer debug messages, etc.
vks::debug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE);
}