OpenGL Profiling in Mac OS

BlitzMax Forums/OpenGL Module/OpenGL Profiling in Mac OS

LethalFrog(Posted 2005) [#1]
I was looking at display lists today and was not really seeing any performance increse from using them, so I ran the profiler on the BM Nehe 12 demo and a Cocoa Nehe 12 Demo.

I was very surprised to see that BM is creating lots of Display lists in fact 256 of them even if you don't use them in your own code.

Below is the output from BM run and Cocoa Run

First BM

GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;3,128;3366938;1076.39;98.83;44.50
glGetDoublev;12,512;11302;0.90;0.33;0.15
glNewList;258;10420;40.39;0.31;0.14
glGetIntegerv;12,517;10238;0.82;0.30;0.14
glEndList;258;6872;26.64;0.20;0.09
glTexImage2D;1;897;897.64;0.03;0.01
glBindTexture;1;29;29.57;0.00;0.00
glViewport;1;26;26.53;0.00;0.00
glGenTextures;1;22;22.35;0.00;0.00
glGenLists;2;20;10.25;0.00;0.00
glTexParameteri;2;18;9.41;0.00;0.00
glPixelStorei;12;18;1.56;0.00;0.00
glGetBooleanv;2;3;1.57;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;3;0;0.00;0.00;0.00

Now Cocoa

GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;1,386;632337;456.23;99.85;8.01
glTexImage2D;1;486;486.45;0.08;0.01
glEndList;2;103;51.98;0.02;0.00
glNewList;2;98;49.40;0.02;0.00
glViewport;1;71;71.72;0.01;0.00
glBindTexture;1;66;66.52;0.01;0.00
glGenTextures;1;25;25.66;0.00;0.00
glGenLists;1;25;25.39;0.00;0.00
glTexParameteri;2;20;10.15;0.00;0.00
glFrustum;1;18;18.39;0.00;0.00
glMatrixMode;2;16;8.17;0.00;0.00
glLoadIdentity;2;12;6.10;0.00;0.00
CGLUpdateContext;1;0;0.00;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;1;0;0.00;0.00;0.00

The calls to glNewList are 258 in BM 256 + 2 from the app
The calls to glNewList are 2 in Cocoa

I have done a few simple tests and when I use display lists the frame rate does not really change that much and now I have got sidelined looking at why BM is creating things I do not need or want, and possible may even use up some memory.

I was wondering if anyone has any ideas on this or Mark might be able to explain this to me.


teamonkey(Posted 2005) [#2]
It's the font - 256 characters.


LeisureSuitLurie(Posted 2005) [#3]
Does it do this when you use bglCreateContext, or just when you use graphics?


LethalFrog(Posted 2005) [#4]
Not sure what you mean, do you mean by just use graphics that I have not created an Open GL Context


Dreamora(Posted 2005) [#5]
If you use graphics you setup a large system with different other things and controllers, not just an OpenGL Context.


LethalFrog(Posted 2005) [#6]
I just use bglCreateContext


teamonkey(Posted 2005) [#7]
Looking at the source, it appears (on Windows systems at least) that the display lists are generated the first time you call bglDrawText.


LeisureSuitLurie(Posted 2005) [#8]
That makes sense.
If it bothers you, you could delete those display lists.


marksibly(Posted 2005) [#9]
Hi,

Yes, the display lists are for bglDrawText.

If you don't use bglDrawText, the display lists should not be created. If they are, it's a bug!


LethalFrog(Posted 2005) [#10]
I have just removed the entry to bglDrawText and no extra display lists.

Thanks all for the replies