![]() |
|
al_set_target_bitmap on windows performace |
archlinka
Member #17,215
December 2019
|
Hi, I have a problem with perfomance on windows using Allegro. My rendering loop is pretty simple: For maximal zoom of factor 2, the buffer texture has size (resolution * 2). All textures are video bitmaps. On my linux system it works like a charm, I am able to achieve more than 1300 FPS in release build with hundrets of objects each frame (all from single texture in texture atlas). But on the same machine on windows it drops to 30 FPS. Quite diference. I was able to simplify the problem code to simple setup of buffer texture. Even if I simply remove all drawing from the rendering loop and keep this simple code, it is still slow down to 100 FPS: main_texture_->set_as_render_target(); al_set_target_bitmap(al_get_backbuffer(al_get_current_display())); If I comment these two lines I have more than 2400 FPS. Do you have any idea where the problem could be? Thank you very much for your answers. EDIT: |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
archlinka, Awesome that you found a solution. Thanks for sharing. How many fps did you get with NO_PRESERVE_TEXTURE enabled? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Frank Drebin
Member #2,987
December 2002
![]() |
I found the same increase in FPS when creating the buffer with the flag ALLEGRO_NO_PRESERVE_TEXTURE is enabled: {"name":"612405","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/7\/e7a4fd05a8d04faf1b1320a0911833f2.png","w":1301,"h":513,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/7\/e7a4fd05a8d04faf1b1320a0911833f2"} |
archlinka
Member #17,215
December 2019
|
It seems that the slowdown increases with size of the buffer texture. So in my case where the size was 5120x2160, the difference was huge. Without the flag I got 30 FPS, with the flag a get over 1400 FPS |
GullRaDriel
Member #3,861
September 2003
![]() |
Wow the speed increase is great ! How can I try ? "Code is like shit - it only smells if it is not yours" |
|