are you completly up to date with your packages ?
i just ran your latest version on my raspberry pi3 and i'm getting huge FPS amounts on my pi3
the 1st value is when i was looking at the screen using vnc viewer, the 2nd value is when i had vnc viewer closed (it has an impact on fps i noticed it in my game as well).
I'm just using latest raspbian buster, with an sd card that i initially had setup on a rapsberry pi4 and just inserted the sd card in my pi 3 and it gave me those numbers.
However on my pi4 i'm only getting about 70 FPS for the same compiled code while looking with vnc, have not tried without looking with vnc.
It baffles me that the rpi3 is way faster with the same image compared to the pi4 but the pi4 probably uses different implementation and not sure what the pi3 uses. I'm guessing the bcrm * files but not sure.
I really wonder why this rans so bad on my pi 4 (the last version have not tried other version) with exact same sd card
can you check to see if you are up to date (mesa got updated)
I also tried your initial version posted in 1st post there i only get these values (on the pi3)
i also have a pi 2 but when i was testing with my game SDL_RENDERER_ACCELERATED was slower than SDL_RENDERER_SOFTWARE in my game so i won't be using hw acceleration or my game can't run on rpi2 at least not nicely. I have not tried your blitting routines on my pi2 can do so if you like. And software rendering was slow if i used RGBA8888 but fast if i used ARGB8888 texture for a surface i'm blitting everything on first. something weird is going on i think at my end. my games which hardly does anything intensive gets about 50 fps if i enabled HW and with ARGB8888 & Software i get 150 fps, if i use software & RGBA8888 i get also about 50 fps for an upscaled 320x240 screen to 640x480 (using sdl) this is on a raspberry pi 3 must test again on the 4 to see the difference
Edit just upgraded raspbian packages again. On the Pi4 software is slower than hardware now. Maybe something is switched between rpi 3 & 4 for the 3 i have to use software + ARGB8888 to get 150 fps in my for the Pi4 i have to use accelerated and get 290 fps but running software only gets me around 50 fps (same code that runs at 150 fps in software i don't get it although the info on the pi4 looks more normal) the pi 3 results with my game are weird as software seems to be faster than hardware there
i also ran your code on my pi 4 now (latest version) these the results the pi 4 i get 1st try with vnc connected 2nd without vnc connect but still displaying on a screen
so it seems its slower on the pi 4.
edit2: enabled the opengl / fake kms driver on rpi 3 it was not running before only on my pi4, now my game also runs fast in hw mode on rpi 3 and slow in software mode. retesting the last test code on my rpi with opengl drivers gives me these results
1st vnc connected 2nd not
so the problem was i had legacy mode enabled on rpi 3 and not the opengl driver. But it seems that test code from last version ran faster in legacy mode somehow when i had initially tested it on my rapsberry pi 3. I will have to verify this again to be sure as i can't explain it but at least enabling opengl drivers on both systems (pi3 / 4) gives better results in hw than in software as it should and i'm seeing the same on my rpi 4 (software slower than hardware)
edit3: those high fps results in the last version of the test program was using legacy driver i just tested all 3 drivers. legacy reports 300 fps, full / fake opengl - kms driver show about the same results about 100 fps when running with vnc viewer open. I'm guessing the legacy driver was just broken or something and things don't work correctly when using hardware acceleration and it shows wrong fps results probably but i did not test further only ran that last test with the 3 modes on a rpi 3
final edit: i can reproduce the high fps on rpi4 also by disabling opengl driver
:~/projecten/SDL2TEST $ ./SDL2Test
2876 frames in 5001 ms = 575.085 FPS
Also the test seems broken. It does not specify RMASK, GMASK, BMASK, AMASK in the bitmap creation.
if i specify those for example
Code: Select all
SDL_Surface *bmp1 = SDL_CreateRGBSurface(0, 640, 480, 32, 0x000000FF, 0xFF000000, 0x00FF0000, 0x0000FF00);
i only get 50 fps in the same test then in legacy mode and not reporting such high nrs. So the way to go is to enable opengl driver and use hardware acceleration from what i can see