Fix an off-by-one in shader bundle generation. Non-ASCII characters would inadvertently become two bytes instead of one, which would (for shaders after that in the bundle) give the wrong offsets and thus potentially corrupted shaders. Normally, this wouldn't really be noticed since the first things are comments and the lasts are #undef, but in some cases, the shader compilers would complain on suspicious things. Reported by Stefano Rivera, who also provided a test system for debugging.
Compile shaders into the library. This was long overdue; I was reluctant for a while since it's easier to develop or debug shaders this way, but the solution is of course to give priority to the filesystem. It is now allowed to give "" as the data directory, which will only ever look in the bundle. Most users should probably just do that. Shaders are no longer installed by make install. There is no API or ABI break, but of course, you cannot give "" as directory to older versions (it would mean essentially /).
Use exact sRGB matrix values. https://photosauce.net/blog/post/what-makes-srgb-a-special-color-space alerted me to that sRGB does not use the exact same matrix as Rec. 709; it demands specific, rounded-off values. The difference should be minute, but now we are at least exact in the forward direction. Note that this isn't an ABI break per se, even though the definition of the COLORSPACE_sRGB enum changes; old software will simply still continue to treat it as Rec. 709, while newly-compiled software will get the corrected version.
Fix an issue where temporary textures could be reused too early by a different thread. When an EffectChain is done rendering (ie., has submitted all of the GL rendering commands that it needs to), it releases all of the temporary textures it's used back to a common freelist. However, if another thread needs a texture of the same size and format, it could be picking it off of the freelist before the GPU has actually completed rendering the first thread's command list, and start uploading into it. This is undefined behavior in OpenGL, and can create garbled output depending on timing and driver. (I've seen this on at least the classic Intel Mesa driver.) Fix by setting fences, so that getting a texture from the freelist will have an explicit ordering versus the previous work. This increases the size of ResourcePool::TextureFormat, but it is only ever used in a private std::map. std::map is node-based (it has to, since the C++ standard requires iterators to it to be stable), and thus, sizeof(TextureFormat) does not factor into sizeof(ResourcePool), and thus, there is no ABI break. Verified by checking on libstdc++.
Fix an issue where we'd add an unneeded bounce for mipmaps in some cases. Specifically, if we didn't need to bounce for mipmaps, but bounced for some other reason (e.g. resizing), we'd still propagate the mipmap requirements. This could lead to yet another bounce earlier up the chain. A typical case would be YCbCrInput -> GammaExpansionEffect -> ResizeEffect, where we'd have a completely unneccessary bounce between the input and the gamma expansion.
Fix more confusion with strong one-to-one effects and compute shaders. The resulting unit test also found an issue where we could add a dummy effect at the end but then end up not having a compute shader there, which would cause OpenGL errors as the internal state got confused, so fix that as well.