Imagination PowerVR SDK Blog

glFramebufferTexture2D copy it's data

pvrtrace
pvrtune

#1

 Hi, All.

I'm doing some post-process work on iPad (iOS 4.3.5) and want to squeeze every microsecond to improve FPS. 'POWERVR SGX OpenGL ES 2.0 Application Development Recommendations' contains a topic about render-to-texture. It recommends to clear entire target before any rendering to skip copy texture content from external memory to on-chip dedicated memory. I try 2 scenarios with clear and without, both of them results in the same time. Is there a way to speed-up this use-case?


1)

glBindFramebuffer();

glViewport();

glClear();

glDraw(); // draw full-screen quad


2) 

glBindFramebuffer();


glViewport();

glDraw(); // draw full-screen quad


  


#2

Hi,

Calling glClear() prevents the GPU having to preserve render buffer data - e.g. the colour buffer - as preserving this data requires is to be loaded from external memory to the on-chip buffers. By calling the glClear(), you can prevent your application wasting memory bandwidth for information that isn’t required by the next frame’s render.

As this is a memory bandwidth use optimization, you are unlikely to see the benefit of this when your application isn’t already memory bandwidth limited. If you profile the performance of your application (using our PVRUniSCoEditor, PVRTune & PVRTrace tools, and/or Apple’s profiling tools in Xcode) where the bottleneck is in your rendering.

In many cases, the bottleneck hit first by most applications is shader complexity (particularly fragment shaders), and you can use our PVRUniSCoEditor utility to get in-line cycle count estimates to understand how complex your shaders are while you are editing them.

Hope that helps :slight_smile:




#3

 Can you answer how much time is need to upload 1027x768 texture data of format ARGB8888 to dedicated on-chip memory?