Added OpenGL debug groups for most graphics operations when love is built in debug mode for iOS. The Xcode frame capture tool uses them to create nice visual groups for OpenGL function calls.

This commit is contained in:
Alex Szpakowski
2015-03-16 22:55:58 -03:00
parent 14cbc91e7f
commit 06ef263537
12 changed files with 64 additions and 0 deletions
+12
View File
@@ -198,6 +198,8 @@ bool Canvas::createMSAAFBO(GLenum internalformat)
bool Canvas::loadVolatile()
{
OpenGL::TempDebugGroup debuggroup("Canvas load");
fbo = depth_stencil = texture = 0;
resolve_fbo = msaa_buffer = 0;
status = GL_FRAMEBUFFER_COMPLETE;
@@ -298,6 +300,8 @@ void Canvas::unloadVolatile()
void Canvas::drawv(const Matrix &t, const Vertex *v)
{
OpenGL::TempDebugGroup debuggroup("Canvas draw");
OpenGL::TempTransform transform(gl);
transform.get() *= t;
@@ -439,6 +443,8 @@ void Canvas::startGrab(const std::vector<Canvas *> &canvases)
canvaseschanged = true;
}
OpenGL::TempDebugGroup debuggroup("Canvas set");
setupGrab();
// Don't attach anything if there's nothing to change.
@@ -471,6 +477,8 @@ void Canvas::startGrab(const std::vector<Canvas *> &canvases)
void Canvas::startGrab()
{
OpenGL::TempDebugGroup debuggroup("Canvas set");
setupGrab();
if (attachedCanvases.size() == 0)
@@ -488,6 +496,8 @@ void Canvas::stopGrab(bool switchingToOtherCanvas)
if (current != this)
return;
OpenGL::TempDebugGroup debuggroup("Canvas un-set");
// Make sure the canvas texture is up to date if we're using MSAA.
resolveMSAA(false);
@@ -524,6 +534,8 @@ bool Canvas::checkCreateStencil()
if (depth_stencil != 0)
return true;
OpenGL::TempDebugGroup debuggroup("Canvas create stencil");
if (current != this)
gl.bindFramebuffer(GL_FRAMEBUFFER, fbo);