diff --git a/base/VulkanDebug.cpp b/base/VulkanDebug.cpp index 7ab33629..e1656689 100644 --- a/base/VulkanDebug.cpp +++ b/base/VulkanDebug.cpp @@ -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()); } diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 1f26a8ad..261ade0e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -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); }