This isn't quite an answer (yet), but I'm posting in the hope that it'll help get to one.
So, I just hit this on my Pixel XL in chrome, and looking into the source, we're hitting an "assert" in BakedOpRenderer.cpp:
void BakedOpRenderer::endLayer() {
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);
GL_CHECKPOINT(MODERATE);
mCaches.renderBufferCache.put(mRenderTarget.stencil);
mRenderTarget.stencil = nullptr;
}
mRenderTarget.lastStencilClip = nullptr;
mRenderTarget.offscreenBuffer->updateMeshFromRegion();
mRenderTarget.offscreenBuffer = nullptr; // It's in drawLayerOp's hands now.
// Detach the texture from the FBO
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
GL_CHECKPOINT(LOW);
mRenderState.deleteFramebuffer(mRenderTarget.frameBufferId);
mRenderTarget.frameBufferId = 0;
}
Where we're hitting the GL_CHECKPOINT(LOW)
block.
The macro is defined in GLUtils.h as:
#if DEBUG_OPENGL
#define GL_CHECKPOINT(LEVEL) \
do { if (DEBUG_OPENGL >= DEBUG_LEVEL_##LEVEL) {\
LOG_ALWAYS_FATAL_IF(android::uirenderer::GLUtils::dumpGLErrors(),\
"GL errors! %s:%d", __FILE__, __LINE__);\
} } while (0)
#else
#define GL_CHECKPOINT(LEVEL)
#endif
(DEBUG_OPENGL
seems to default to DEBUG_LEVEL_LOW
)
The function that actually does the work, dumpGLErrors, is defined in GLUtils.cpp, as:
bool GLUtils::dumpGLErrors() {
#if DEBUG_OPENGL >= DEBUG_LEVEL_HIGH
// If DEBUG_LEVEL_HIGH is set then every GLES call is already wrapped
// and asserts that there was no error. So this can just return success.
return false;
#else
bool errorObserved = false;
GLenum status = GL_NO_ERROR;
while ((status = glGetError()) != GL_NO_ERROR) {
errorObserved = true;
switch (status) {
case GL_INVALID_ENUM:
ALOGE("GL error: GL_INVALID_ENUM");
break;
case GL_INVALID_VALUE:
ALOGE("GL error: GL_INVALID_VALUE");
break;
case GL_INVALID_OPERATION:
ALOGE("GL error: GL_INVALID_OPERATION");
break;
case GL_OUT_OF_MEMORY:
ALOGE("GL error: Out of memory!");
break;
default:
ALOGE("GL error: 0x%x", status);
}
}
return errorObserved;
#endif
}
Here, my problem gets weird. You have the GL error: 0x506
line in your log, but I don't.
Your error is an GL_INVALID_FRAMEBUFFER_OPERATION
error, and it looks like you need to look into that.
However, if you wanted to get more info, you'd need to recompile the Android hwui lib with something like DEBUG_LEVEL_HIGH
, and maybe a other options.
On my side, I have no clue, since the crash in chrome didn't leave the "GL error" in logcat
. Grr.