drpatrik/combatris

Uses 100% CPU on main title screen

HugoKlepsch opened this issue · 3 comments

Uses 100% of one core on the title screen. It also lagged a video playing in the background, making me think it's also doing bad things with the GPU.

What hardware are you using? All GPU related rendering is performed by SDL the graphic library. It seams to me as GPU rendering is not turned on and SDL is using CPU based rendering. On my raspberry I had to manually turn on GPU rendering otherwise rendering is done on the CPU. On my raspberry PI 3B+ CPU utilisation is ~45 and on my Mac CPU utilisation is 30% on one core.

I have added two functions that show which rendering drivers are available and if they support accelerated rendering. I also display which driver was actually selected. This is how it looks like on my Mac:

4 Render drivers available:
0: "metal" supports accelerated rendering: Yes
1: "opengl" supports accelerated rendering: Yes
2: "opengles2" supports accelerated rendering: Yes
3: "software" supports accelerated rendering: No
Using renderer: metal

The code is available in the develop branch. Could you pls see what you get on your computer?

This is how it looks like on my Raspberry Pi 4:

4 Render drivers available:
0: "opengl" supports accelerated rendering: Yes
1: "opengles2" supports accelerated rendering: Yes
2: "opengles" supports accelerated rendering: Yes
3: "software" supports accelerated rendering: No
Using renderer: opengl

CPU utilization on the title screen is ~40%