`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
----------
// 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();
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());
}
}
}