Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » ogl_flush_vertex_cache very slow on osx

This thread is locked; no one can reply to it. rss feed Print
ogl_flush_vertex_cache very slow on osx
sleepywind
Member #14,665
October 2012

I have been doing some profiling in the game I am working on (www.factorio.com for the curious) and I noticed that the ogl_flush_vertex_cache is taking quite a lot of time on the stack (like 20% of the total application time). This is on the OSX only (0SX 10.6.8), the windows / linux version work fine.

We are doing a lot of drawing from our internal atlas that is wrapped in the al_hold_bitmap_drawing. That is allright. The problem comes when drawing the gui elements (we are using an own modified version of agui). There are like 20 small background images (also from the atlas) on the screen (drawn with variant al_draw_bitmap). And each of them has a number in it (drawn with al_draw_text - I have noticed that this calls the ttf_render which holds the bitmap drawing by default). These all are drawn separetly (without holding), therefore the ogl_flush_vertex_cache is called after every bitmap drawing.

Any ideas why that particular call should be so slow? Could be connected to OSX graphical drivers? I have close to zero knowlege about this.

SiegeLord
Member #7,827
October 2006
avatar

Hmm, can you get more fine grained profiling? That function should only be slow if you're drawing a lot of things... that said, there are one or two OpenGL functions that have been known to be slow in the past in it, but they are necessary.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Go to: