Commit 519163ee by Jamie Madill Committed by Commit Bot

Run debug callback in perf render tests.

This can catch unexpected GL errors from ANGLE or the system driver. Only enable when ASSERTs are enabled to ensure that we get full performance when profiling. Helpful to diagnose incorrect perf test rendering. In this case it helped diagnose that our frame tracing and replay do not correctly remap uniform locations. Bug: angleproject:3630 Change-Id: Ifd9f47196381e48f74a810ea0c9f9c0fd7a13a22 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057352 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTobin Ehlis <tobine@google.com>
parent b8c6521a
...@@ -157,6 +157,17 @@ void DumpTraceEventsToJSONFile(const std::vector<TraceEvent> &traceEvents, ...@@ -157,6 +157,17 @@ void DumpTraceEventsToJSONFile(const std::vector<TraceEvent> &traceEvents,
outFile.close(); outFile.close();
} }
ANGLE_MAYBE_UNUSED void KHRONOS_APIENTRY DebugMessageCallback(GLenum source,
GLenum type,
GLuint id,
GLenum severity,
GLsizei length,
const GLchar *message,
const void *userParam)
{
std::cerr << "%s\n";
}
} // anonymous namespace } // anonymous namespace
ANGLEPerfTest::ANGLEPerfTest(const std::string &name, ANGLEPerfTest::ANGLEPerfTest(const std::string &name,
...@@ -498,6 +509,23 @@ void ANGLERenderTest::SetUp() ...@@ -498,6 +509,23 @@ void ANGLERenderTest::SetUp()
return; return;
} }
#if defined(ANGLE_ENABLE_ASSERTS)
if (IsGLExtensionEnabled("GL_KHR_debug"))
{
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr,
GL_TRUE);
glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_MEDIUM, 0, nullptr,
GL_TRUE);
glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, nullptr,
GL_FALSE);
glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_NOTIFICATION, 0,
nullptr, GL_FALSE);
glDebugMessageCallbackKHR(DebugMessageCallback, this);
}
#endif
initializeBenchmark(); initializeBenchmark();
if (mTestParams.iterationsPerStep == 0) if (mTestParams.iterationsPerStep == 0)
...@@ -583,6 +611,10 @@ void ANGLERenderTest::step() ...@@ -583,6 +611,10 @@ void ANGLERenderTest::step()
// command queues. // command queues.
mGLWindow->swap(); mGLWindow->swap();
mOSWindow->messageLoop(); mOSWindow->messageLoop();
#if defined(ANGLE_ENABLE_ASSERTS)
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
#endif // defined(ANGLE_ENABLE_ASSERTS)
} }
endInternalTraceEvent("step"); endInternalTraceEvent("step");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment