Thank you for your answer. Yes, you understand what I want to do.
Let me talk about the background of the problem:
Use TI chip TDA4 (based on OpenVX architecture) for rendering.
As they(TI) said before, in the case of TDA4, the display is driven by R5, so TDA4 uses FBO for rendering outside.
The rendering process in TDA4:
… …
-
texYuv[i] = appEglWindowGetTexYuv(pEglWindowObj, &texProp[i]);
… …
appEglBindFrameBuffer(glSrvParams->eglWindowObj, &renderTexProp);
FBO is used in this function
glGenTextures(1, &tex_obj->tex);
glBindTexture(GL_TEXTURE_2D, tex_obj->tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glGenFramebuffers(1, &tex_obj->fboId);
glBindFramebuffer(GL_FRAMEBUFFER, tex_obj->fboId);
GLuint rboDepthStencil;
glGenRenderbuffers(1, &rboDepthStencil);
glBindRenderbuffer(GL_RENDERBUFFER, rboDepthStencil);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, prop->width, prop->height);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rboDepthStencil);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rboDepthStencil);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, tex_obj->tex);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)tex_obj->img);
glBindFramebuffer(GL_FRAMEBUFFER, tex_obj->fboId);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D, tex_obj->tex, 0);
… …
3. render_renderFrame(&glSrvParams->render3DSRVObj,glSrvParams->eglWindowObj,texYuv);
Here is the texture unit texYuv
that has been bound in step 1.
Now the problem is here: if I use a new FBO in render_renderFrame
(not the same as tex_obj->fboId
in appEglBindFrameBuffer
in step 2),
Here it will report 0x506 GL_INVALID_FRAMEBUFFER_OPERATION
error, so nothing can be drawn.
The reason why I use a new FBO here is that I want to draw A first, then draw B, and finally display it as a new texture after processing.
My usage is as described before, here is the wrong method I used?
Or is there any other way to achieve what I want?
-
glFinish();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
appEglSwap(glSrvParams->eglWindowObj);
I feel that the crux of the problem lies in:
In the case of TDA4, the display is driven by R5, so TDA4 uses FBO for rendering outside.(The display in other case such as TDA2 was driven by EGL and thus the swap.)
In this way, we can no longer create and use other FBOs in render_renderFrame()
.
What needs to be solved now is:
TDA4 uses FBO outside,
How to create and use other FBOs in render_renderFrame()?