Hotfixed bizzare non-monotonically-increasing SDL_GetPerformanceCounter bug #6189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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
, sometimesvalgrind
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 :-)