The current implementation works insofar as that there is no deadlock,
but unfortunately the `entries` data can become corrupted enough for
the program to crash in the C++ stdlib.
For the new solution we use a shared_timed_mutex, allowing shared read
access to `entries`, and only acquire a unique lock for writing. Since
this can run into a deadlock if an error happens during rendering of
the backlog itself, we only wait 33ms to acquire it (1 frame @ 30 fps).
If we can't get it by that time, we still write to debug output, but not
into `entries`.
The shared_timed_mutex also allows us to wait for a read lock at the
end of the program, so we now wait for 1s instead of giving up immediately.
This commit also fixes a missing synchronization when accessing `history`
that was accidentially removed.
* When rendering the backlog, a GPU call might fail, causing
wilog_assert to write to the backlog. This would then try
to acquire the `entriesLock` (formerly `logLock`) but deadlock since
the thread already holds it. Fix it by replacing SpinLock with
std::recursive_lock.
Reduce the time for how long the lock is held to only apply
to when `entries` is accessed.
Ensure we will not hang on destruction of LogWriter, even if
the program aborts while another thread holds the entriesLock.
* wi_assert: Add parenthesis around if condition to ensure it works
correctly in edge cases, like `i >= 0`
* add deprecation attribute to `input`, `acceptInput`, `deleteFromInput`
so people who still reference them can remove the now pointless calls.
IMGUI leaves the scissor in a random state. This messes up the color normalization in HDR10, where the scissor needs to include the whole viewport. Restore the scissor after IMGUI is done drawing stuff.