Add helpers to set/push/pop markers on GL

This commit is contained in:
baldurk
2019-05-03 12:27:21 +01:00
parent 2ae29bbecb
commit a42220a035
2 changed files with 23 additions and 0 deletions
+19
View File
@@ -212,6 +212,25 @@ GLuint OpenGLGraphicsTest::MakeFBO()
return fbos[fbos.size() - 1];
}
void OpenGLGraphicsTest::pushMarker(const std::string &name)
{
if(glPushDebugGroup)
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name.c_str());
}
void OpenGLGraphicsTest::setMarker(const std::string &name)
{
if(glDebugMessageInsert)
glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 0,
GL_DEBUG_SEVERITY_LOW, -1, name.c_str());
}
void OpenGLGraphicsTest::popMarker()
{
if(glPopDebugGroup)
glPopDebugGroup();
}
bool OpenGLGraphicsTest::Running()
{
if(!FrameLimit())
+4
View File
@@ -52,6 +52,10 @@ struct OpenGLGraphicsTest : public GraphicsTest
GLuint MakeVAO();
GLuint MakeFBO();
void pushMarker(const std::string &name);
void setMarker(const std::string &name);
void popMarker();
bool Running();
void Present(GraphicsWindow *window);
void Present() { Present(mainWindow); }