Add fine-grained debug layer
Full GLES error checking layer via -include
trickery. Change DEBUG_OPENGL to a level system.
HIGH = every GL call is error checked
MODERATE = checkpointing at interesting spots
LOW = only asserts there are no errors at the end of a frame
or when the FBO changes
NONE = AIN'T GOT NO TIME FOR ERRORS GOTTA GO FAST!
Change-Id: Ibe81aae93d942059c4ddf1cbb11c828b7ce4c10b
diff --git a/libs/hwui/BakedOpRenderer.cpp b/libs/hwui/BakedOpRenderer.cpp
index e65746e..c752526 100644
--- a/libs/hwui/BakedOpRenderer.cpp
+++ b/libs/hwui/BakedOpRenderer.cpp
@@ -49,7 +49,8 @@
// attach the texture to the FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
offscreenBuffer->texture.id(), 0);
- LOG_ALWAYS_FATAL_IF(GLUtils::dumpGLErrors(), "startLayer FAILED");
+ GL_CHECKPOINT(LOW);
+
LOG_ALWAYS_FATAL_IF(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE,
"framebuffer incomplete!");
@@ -63,7 +64,7 @@
if (mRenderTarget.stencil) {
// if stencil was used for clipping, detach it and return it to pool
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
- LOG_ALWAYS_FATAL_IF(GLUtils::dumpGLErrors(), "glfbrb endlayer failed");
+ GL_CHECKPOINT(MODERATE);
mCaches.renderBufferCache.put(mRenderTarget.stencil);
mRenderTarget.stencil = nullptr;
}
@@ -74,8 +75,7 @@
// Detach the texture from the FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
- LOG_ALWAYS_FATAL_IF(GLUtils::dumpGLErrors(), "endLayer FAILED, bound fbo = %u",
- mRenderState.getFramebuffer());
+ GL_CHECKPOINT(LOW);
mRenderState.deleteFramebuffer(mRenderTarget.frameBufferId);
mRenderTarget.frameBufferId = 0;
}
@@ -139,8 +139,6 @@
mCaches.pathCache.trim();
mCaches.tessellationCache.trim();
- GL_CHECKPOINT();
-
#if DEBUG_MEMORY_USAGE
mCaches.dumpMemoryUsage();
#else