* fix(render): the python upload thread only marks the texture unit cache stale, the drawing thread clears it
update_from_memory() runs on the python upload thread with python.threadedupload (the default), and since
e230d7b9 it cleared opengl_texture::units there outright. That raced Bind_Material filling the same array
for its multi-bind: a unit reset between the fill and glBindTextures() made the bind of that unit fail, and
the object was drawn with the texture of the one drawn before it, for a frame, at the rate of the screens.
The thread now sets an atomic flag, and the drawing thread clears the cache when it next binds textures
(bind() and the multi-bind of Bind_Material), so a screen texture given a new gl name is still rebound.
* fix(app): fpslimit asks Windows for the 1 ms timer, the frames no longer come in turns long and short
The wait of fpslimit sleeps, and Windows wakes a process which didn't ask for a finer timer in steps of
up to ~15.6 ms. A 10 ms slot of fpslimit 100 ended ~15.6 ms later, the pacer made it up with no wait in the
next frame, and with vsync on the frames were shown for one or two refreshes in turn: visible stutter at a
steady FPS. timeBeginPeriod(1) is held from the settings to the exit, only when fpslimit is set.
* fix: the 1 ms timer also for an fpslimit set by the scenery, the stale unit cache checked with a plain load first
A config block of the scenery is parsed after the settings and can set fpslimit, so the timer period is
asked for at the first wait of the pacer too, once. bind() checks the stale flag of the unit cache with a
relaxed load before the exchange, which it does for every texture.
* fix(textures): the stale flag of the unit cache uses the default memory order (Sonar S8417)
On x86 a sequentially consistent load and exchange cost the same as the
relaxed and acq_rel ones; only the store in invalidate_unit_cache() becomes
an xchg, and it runs rarely.
---------
Co-authored-by: maj00r <maj00r@host>