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

Hotfixed bizzare non-monotonically-increasing SDL_GetPerformanceCounter bug #6189

Conversation

adamkewley
Copy link
Contributor

@adamkewley adamkewley commented Feb 23, 2023

This is a casual suggestion for hot-fixing a bug that I'm encountering when using an ImGui UI in a virtual machine. The reason I needed this hotfix is because, without it, an assertion elsewhere in ImGui (Assertion (g.IO.DeltaTime > 0.0f || g.FrameCount == 0) && "Need a positive DeltaTime!) will trigger and crash the application (downstream: ComputationalBiomechanicsLab/opensim-creator#617)

This issue appears to be related to #6114 and #3644. The difference here is that I'm running ImGui in a standard x86_64 Ubuntu22 desktop environment, rather than as a wasm binary in a browser - but I'm running it inside a VirtualBox VM, which may trigger various hypervisor/CPU mitigations etc. that aren't enabled in a bare-metal machine.


More Context

I develop OpenSim Creator, which uses ImGui+SDL+OpenGL to render:

screenshot

Whenever I do a full QA pass on it (e.g. right now, for 0.4.0) I try to go through all of the documentation, new features, etc. manually on a Linux build with NDEBUG=0, all assertions force-enabled, libASAN, sometimes valgrind etc. to ensure that as many runtime bugs as possible are shook out before shipping (this should probably be automated 😉).

To do that, I use a VM because it means I can mostly keep developing on my Windows machine, and it's easier to snapshot VMs, have multiple OSes, etc. - it's not that I believe my UI is likely to be used in a VM very often :-)

@adamkewley adamkewley changed the title Hotfixed bizzare non-monotonically-increasing SDL_GetPerformanceCouner Hotfixed bizzare non-monotonically-increasing SDL_GetPerformanceCounter bug Feb 23, 2023
ocornut pushed a commit that referenced this pull request Feb 23, 2023
@ocornut
Copy link
Owner

ocornut commented Feb 23, 2023

Thank you Adam!
This was tweaked into 2496b97 and merged (also added same change in SDL3 backend).

this should probably be automated 😉

You may want to check https://github.com/ocornut/imgui_test_engine

@ocornut ocornut closed this Feb 23, 2023
@adamkewley
Copy link
Contributor Author

Ah, lovely!

You may want to check https://github.com/ocornut/imgui_test_engine

I will! I'm desperate for some UI automation ❤️

ocornut added a commit that referenced this pull request Jun 12, 2023
Intrets pushed a commit to Intrets/imgui that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants