From e441ef723a54db06c7324cec4614646d0b8bb89d Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Thu, 14 Apr 2016 11:40:50 -0700 Subject: [PATCH] Do not log INFO and DEBUG messages by default Validation layers produce a lot of INFORMATION and DEBUG messages that are not useful most of the time, and just bloat the log. Ignore these message types by default. Documented Validation layer usage in Vulkan CTS README. Bug: 28175931 Change-Id: I0f56d0373e0eb5d7e2849670b4284c457eab8c04 --- external/vulkancts/README.md | 18 ++++++++++++++++++ external/vulkancts/modules/vulkan/vktTestPackage.cpp | 19 +++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/external/vulkancts/README.md b/external/vulkancts/README.md index 7985148..8e854bf 100644 --- a/external/vulkancts/README.md +++ b/external/vulkancts/README.md @@ -304,6 +304,24 @@ vkNullDriver.cpp. To use that, implement `vk::Platform::createLibrary()` with `vk::createNullDriver()`. +Validation Layers +----------------- + +Vulkan CTS framework includes first-party support for validation layers, that +can be turned on with `--deqp-validation=enable` command line option. + +When validation is turned on, default instance and device will be created with +validation layers enabled and debug callback is registered to record any +messages. Debug messages collected during test execution will be included at +the end of the test case log. + +If any validation errors are found, test result will be set to `InternalError`. + +By default `VK_DEBUG_REPORT_INFORMATION_BIT_EXT` and `_DEBUG_BIT_EXT` messages +are excluded from the log, but that can be customized by modifying +`vkt::TestCaseExecutor::deinit()` in `vktTestPackage.cpp`. + + Cherry GUI ---------- diff --git a/external/vulkancts/modules/vulkan/vktTestPackage.cpp b/external/vulkancts/modules/vulkan/vktTestPackage.cpp index 69d51fc..f654e67 100644 --- a/external/vulkancts/modules/vulkan/vktTestPackage.cpp +++ b/external/vulkancts/modules/vulkan/vktTestPackage.cpp @@ -247,6 +247,12 @@ void TestCaseExecutor::deinit (tcu::TestCase*) // Collect and report any debug messages if (m_debugReportRecorder) { + // \note We are not logging INFORMATION and DEBUG messages + static const vk::VkDebugReportFlagsEXT errorFlags = vk::VK_DEBUG_REPORT_ERROR_BIT_EXT; + static const vk::VkDebugReportFlagsEXT logFlags = errorFlags + | vk::VK_DEBUG_REPORT_WARNING_BIT_EXT + | vk::VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT; + typedef vk::DebugReportRecorder::MessageList DebugMessages; const DebugMessages& messages = m_debugReportRecorder->getMessages(); @@ -255,20 +261,21 @@ void TestCaseExecutor::deinit (tcu::TestCase*) if (messages.begin() != messages.end()) { const tcu::ScopedLogSection section (log, "DebugMessages", "Debug Messages"); - bool anyErrors = false; + int numErrors = 0; for (DebugMessages::const_iterator curMsg = messages.begin(); curMsg != messages.end(); ++curMsg) { - log << tcu::TestLog::Message << *curMsg << tcu::TestLog::EndMessage; + if ((curMsg->flags & logFlags) != 0) + log << tcu::TestLog::Message << *curMsg << tcu::TestLog::EndMessage; - if ((curMsg->flags & vk::VK_DEBUG_REPORT_ERROR_BIT_EXT) != 0) - anyErrors = true; + if ((curMsg->flags & errorFlags) != 0) + numErrors += 1; } m_debugReportRecorder->clearMessages(); - if (anyErrors) - m_context.getTestContext().setTestResult(QP_TEST_RESULT_INTERNAL_ERROR, "API usage error found"); + if (numErrors > 0) + m_context.getTestContext().setTestResult(QP_TEST_RESULT_INTERNAL_ERROR, (de::toString(numErrors) + " API usage errors found").c_str()); } } } -- 2.7.4