Use explicit validation layer names on Android (no meta layer available)
This commit is contained in:
parent
418f4e2875
commit
2accf02c1e
2 changed files with 19 additions and 8 deletions
|
|
@ -15,14 +15,25 @@ namespace vks
|
||||||
{
|
{
|
||||||
namespace debug
|
namespace debug
|
||||||
{
|
{
|
||||||
int validationLayerCount = 1;
|
#if !defined(__ANDROID__)
|
||||||
const char *validationLayerNames[] =
|
// On desktop the LunarG loaders exposes a meta layer that contains all layers
|
||||||
{
|
int32_t validationLayerCount = 1;
|
||||||
// This is a meta layer that enables all of the standard
|
const char *validationLayerNames[] = {
|
||||||
// validation layers in the correct order :
|
|
||||||
// threading, parameter_validation, device_limits, object_tracker, image, core_validation, swapchain, and unique_objects
|
|
||||||
"VK_LAYER_LUNARG_standard_validation"
|
"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_vkCreateDebugReportCallbackEXT CreateDebugReportCallback = VK_NULL_HANDLE;
|
||||||
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallback = VK_NULL_HANDLE;
|
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallback = VK_NULL_HANDLE;
|
||||||
|
|
@ -75,7 +86,7 @@ namespace vks
|
||||||
std::stringstream debugMessage;
|
std::stringstream debugMessage;
|
||||||
debugMessage << prefix << " [" << pLayerPrefix << "] Code " << msgCode << " : " << pMsg;
|
debugMessage << prefix << " [" << pLayerPrefix << "] Code " << msgCode << " : " << pMsg;
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(__ANDROID__)
|
||||||
if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
|
if (flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
|
||||||
LOGE("%s", debugMessage.str().c_str());
|
LOGE("%s", debugMessage.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -754,7 +754,7 @@ void VulkanExampleBase::initVulkan()
|
||||||
{
|
{
|
||||||
// The report flags determine what type of messages for the layers will be displayed
|
// 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
|
// 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.
|
// Additional flags include performance info, loader and layer debug messages, etc.
|
||||||
vks::debug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE);
|
vks::debug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue