Hello,
I debugged my graphic application via mali debugger and I get confused with the information I captured. Here's my questions.
1. a frame contains several render passes(eg. render pass 0, render pass 1, ...) and framebuffers(eg. framebuffer 0, framebuffer 1, ...). What is a render pass and a framebuffer(framebuffer 0, framebuffer 1, ...) mean? Does it mean a single object in a frame?
2. I've read a blog https://community.arm.com/groups/arm-mali-graphics/blog/2014/04/28/mali-graphics-performance-2-how-to-correctly-handle-framebuffers, it's impressive. There are two render targets in OpenGL ES, on-screen render target and off-screen render target. As is known, Mali GPU has two framebuffers on hardware, FB0 and FB1. What is the relationship between render targets and framebuffer(FB0 and FB1)?
What is a render pass?
A render pass is a sequence of drawing operations which produce an single rendered image (may be off-screen or on-screen).
What is a framebuffer object?
A container for the memory which a render-pass is writing; e.g. may consist of one (or more) color buffers, a depth buffer, and a stencil buffer.
There are two render targets in OpenGL ES, on-screen render target and off-screen render target.
OpenGL ES has two *types* of render target, but there can be multiple instances of off-screen render targets (this is application controlled). This can be via the creation of multiple framebuffer objects, or by changing the attachments of an existing framebuffer object.
As is known, Mali GPU has two framebuffers on hardware, FB0 and FB1.
Don't confuse the system framebuffers in FBDEV (or other) window systems and OpenGL ES framebuffer objects - they are not related.
All window surface framebuffers are mapped to the default framebuffer object (FBO 0) in OpenGL ES, EGL and the window system will determine how the phyysical framebuffers are actually used - this is transaparent to the application.
All non-zero framebuffer objects in OpenGL ES are created by the application, and mapped to named framebuffer objects with ID > 0.
HTH,
Pete
Thanks, it really helps!
A single frame consists of several framebuffer objects, a framebuffer object in OpenGL ES means a single image. So how is these images composed? surfaceflinger?
I use OpenGL ES 2.0 and I found that a draw call(eg. glDrawElements(...)) does not strictly corrspond to a glUseProgram(). A glUseProgram() may corrspond to several glDrawElements(...). I noticed that each glDrawElements(...) has a glBindBuffer(...) in front. Does it mean a program(glUseProgram()) is used by multiple glDrawElements(...) but the results are written to different framebuffer objects?
> So how is these images composed? surfaceflinger
Only the window surface (FBO0) is visible to the window system; how the rest are used is down the application. Normally the application will use off-screen renders as a source texture in a later renderpass.
Does it mean a program(glUseProgram()) is used by multiple glDrawElements(...) but the results are written to different framebuffer objects?
The current framebuffer object is set by glBindFramebuffer(). OpenGL ES makes most of the resources orthogonal so they are just building blocks which can be assembled for each operation (e.g. different buffers, textures, programs, and state form one rendering operation, but can be used in other operations too).