Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL performance on iPhone: glAlphaFuncx on the trace

This is kind of weird, but I noticed that up to 40 percents of the rendering time is spent inside glAlphaFuncx. I know that alpha testing is very expensive, but the interesting thing is I do not use it :) No single place of code uses alpha testing, neither do I invoke this function in any other way.

I also checked GL layer for blending on other sorts of stuff which might cause this to happen but it is what it is.

So, if anybody knows what might cause glAlphaFuncx to appear on the performance trace of CPU Sampler, I would be glad to hear it :)

Update: fixed the screenshot link: http://twitpic.com/2afxho/full

Update 2: the function that leads to invokation of glAlpaFuncx contains a single line:

[context presentRenderbuffer:GL_RENDERBUFFER_OES];

Update 3: I tried setting the breakpoint inside this function, but it seems it haven't been invoked at all. I guess profiler is screwed up here...

like image 973
Anton Avatar asked Jul 31 '10 19:07

Anton


1 Answers

It's weird that this function appears on a profiler trace, as you say you aren't using it. Try setting a breakpoint in glAlphaFuncx to see from where it is being called.

But anyway, that should not be a problem, glAlphaFunc will just set a state in the GL server side, it doesn't (or should) do any more processing than that. It shouldn't be a performance problem, maybe it's a bug in the GL implementation or in the profiler.

To be sure, you can disable alpha test with glDisable(GL_ALPHA_TEST).

like image 159
Dr. Snoopy Avatar answered Nov 15 '22 04:11

Dr. Snoopy