Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looks promising, though concerned about CPU usage with software rendering #3

Open
bogen85 opened this issue Sep 23, 2024 · 3 comments

Comments

@bogen85
Copy link

bogen85 commented Sep 23, 2024

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

@Coldzer0
Copy link
Owner

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.

@bogen85
Copy link
Author

bogen85 commented Sep 23, 2024

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
Copy link
Author

bogen85 commented Sep 23, 2024

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants