ImGui-Pascal icon indicating copy to clipboard operation
ImGui-Pascal copied to clipboard

Looks promising, though concerned about CPU usage with software rendering

Open bogen85 opened this issue 1 year ago • 3 comments

I've not played with the code yet. Just ran the ImGui_SDL2_OpenGL3_Demo on Linux64.

  • With hardware rendering CPU and FPS are fine (30 FPS).
  • With software rendering though CPU and FPS are not good... (>1700 FPS)
    • (Well, FPS is good, it is just excessive..., more than 60x 30 FPS)

I'm inexperienced with ImGui in general. I played with it some C++ and had high CPU usage, but that was also with software rendering, and I put a significant delay in the event loop so it was only 4 FPS to get the CPU down.

Looking at your example though give me hope, for a few reasons.

  • The ability use ImGui with FPC
  • That I might be able to figure out the software rendering issues
    • If with FPC I could get the demo down from 1700 FPS to 30 FPS CPU usage might be reasonable.

Hardware rendering GPU: Intel CoffeeLake-S GT2 [UHD Graphics 630] image image

Software rendering CPU: Intel i9-9900K (16) @ 5.000GHz image image

bogen85 avatar Sep 23 '24 05:09 bogen85

Hello @bogen85

I have yet to test the CPU rendering on Linux, but I remember talking to one of my friends on Discord about that. Someone also talked about it in the official imgui repo, and they solved it.

I'll test it on Windows first, see how it performs, and maybe add an FPS limiter.

I hope this repo helps you learn more and lets people know that Pascal is not a dead language.

Regards.

Coldzer0 avatar Sep 23 '24 13:09 Coldzer0

Yeah, 30 FPS rate limiting would be great!

# for software
LIBGL_ALWAYS_SOFTWARE=1 ./ImGui_SDL2_OpenGL3_Demo

# for hardware
./ImGui_SDL2_OpenGL3_Demo

bogen85 avatar Sep 23 '24 13:09 bogen85

FPC targets WASM https://wiki.freepascal.org/WebAssembly/Compiler

And Android https://wiki.freepascal.org/Android#Android_target

And ImGui is making progress on both those targets, which is another reason why ImGui-Pascal gives me hope for some upcoming personal projects, and I was really wanting to use modern and free Object Pascal instead of C++ (yes, also, modern and free...)

bogen85 avatar Sep 23 '24 13:09 bogen85