The GLSL shaders are written in GLSL 1.10 even though the OpenGL standard is
set to OpenGL ES 3.2 Core. Many platforms allow this but some platforms don't.
For standards compliance, it's probably a good idea in the future to upgrade
the shaders to 3.2, but for now we'll use 3.2 Compatibility which will allow the
GLSL 1.10 shaders to compile.
This function was noticeably lagging the main thread while caching. The
cause was OpenEXR's internal thread pool competing with our main
thread. Since we have our own system of worker threads, its thread pool
was unnecessary for caching, however for normal playback it was a useful
optimization. Unfortunately OIIO (which we were using to save EXRs)
didn't provide quite enough control over OpenEXR's threading behavior
(only providing control for over the global thread pool and not on
a per-image basis), so for caching we've switched to using OpenEXR
directly. This has noticeably sped up the main thread while causing no
noticeable slowdown to the caching process.
The encoder was moved to its own thread and will transcode the PCM from the
audio renderer into the chosen codec while the video frames are still
received. The implementation isn't perfect and could use some cleaning up, but
it is functional at the moment.