Why am I getting GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT?

I am developing a game for Android, but my target devices are a little slow. In these devices, the color appears differently, in some cases the red is very opaque. As a solution to this, I made the opengl shader the correct colors to match the device. I load textures from SD, then I render the texture to apply the shader and finally I remove the texture with no effect. This is done once per texture load. The problem is that at some point, my code creating the texture starts to crash.

glActiveTexture(GL_TEXTURE0);
glGenTextures(1, &fbo_texture);
glBindTexture(GL_TEXTURE_2D, fbo_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
glBindTexture(GL_TEXTURE_2D, 0);
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_texture, 0);
// Disable depth buffer
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);

GLint status;
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_texture, 0);
if ((status = glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE) {

      

This works fine, but after a moment it crashes and GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT is always returned.

I have no idea because it starts to fail.

Update : I now only use one FBO for all loaded textures, however I am getting a new error on my android device:

eglLockWindowSurface: failed to map the memory for fd=80 offs=2428928
waitForCondition(LockCondition) time out(identity=14,status=0) CPU may be pegged, trying again

      

+3
android opengl-es render-to-texture


source to share


No one has answered this question yet

Check out similar questions:

3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
1770
Get screen dimensions in pixels
1169
Is there a way to get the source code from the APK file?
1039
Get current time and date on Android
877
Why doesn't RecyclerView have onItemClickListener ()?
nine
How to emulate an accumulation buffer in OpenGL es 2.0 (trailing particle effect)
nine
How do I create an FBO with a stencil buffer in OpenGL ES 2.0?
4
OpenGL ES 2.0 Texturing
4
Why is my fragment shader not reading alpha information when I switch to alpha only (A8) pixelFormat?
0
glCheckFrameBufferStatus () always returns 36054



All Articles
Loading...
X
Show
Funny
Dev
Pics