Changelog:
- Fix an issue where custom shaders with //!SAVE MAIN did not save textures.
- Fix a number of minor memory leaks.
- Fix an issue where custom shaders that tried binding conditionally excluded textures generated superfluous errors.
- Fix an issue where the libav helpers ran into undefined behavior when operating on the 128-bit image formats in recent versions of ffmpeg.
- Fix an issue where freeing pl_shader_obj too early could lead to use-after-free errors if shaders still referenced these objects.
- Fix an issue where applying film grain after debanding could trigger an assertion due to a change in bit depth.
- Fix an issue where film grain generation was unnecessarily verbose due to LUT updates.
- Fix an issue where tone mapping desaturation was not working as intended, resulting in strongly oversaturated colors.
- Fix an issue where the red channel sometimes got unintentionally deleted from RGB input images.
- Fix an issue where AV1 film grain synthesis did not work on pictures above 12 bit depth, such as could be the output of a previous filter.
- Fix an issue where we unintentionally used linear downscaling on HDR sources.
- Fix an issue with false negatives in the PL_GAMUT_WARN algorithm, and also change the algorithm to make it more visually obvious.
Depends on D13919.