Profiling an OpenGL ES Application on iOS

I am looking at a game I am working on in the "OpenGL ES Driver" template under "Tools". The sampler shows that I spend almost all of my time on a function named gfxODataGetNewSurface

with a call tree that looks like this:

  • gfxIODataGetNewSurface

  • gliGetNewIOSurfaceES

  • _ZL29native_window_begin_iosurfaceP23_EAGLNativeWindowObject

  • usleep

  • __semwait_signal

(sorry for the weird formatting, safari or stack overflow have my line breaks)

The game only has about 40 FPS (on iPhone 4), I don't think it's a heavy workload that makes me think I am doing something pathological with my OpenGL code.

Does anyone know what gliGetNewIOSurfaceES

/ does gfxIODataGetNewSurface

? And what it indicates is happening in my application. Is a new render or something else constantly being created?

EDIT: New information ...

I found that with the following pixel shader:

varying vec2 texcoord;

uniform sampler2D sampler ; 
const vec4 color = vec4(...);

void main()                 
    gl_FragColor = color*texture2D(sampler,texcoord);               


(once again my formatting is getting garbled!)

If I change the const 'color' to #define, the Renderer usage drops from 75% to 35% when drawing fullscreen (960x640) sprites to the screen. Indeed, I want this color to be an interpolated "changing" amount from the vertex shader, but if we make it a global constant, then I can't imagine there is any hope that the "changing" version will be better.


source to share

All Articles