A few fixes and refactors for HDR and color management
commit 1: instead of dragging the output string through the whole shader, use a temporary variable
commit 2: fix the calculation for desaturating colors with a wide color gamut, and document how it works
commit 3: use named constants for EOTFs instead of random integers
commit 4: skip color space conversions if not needed
commit 5: use the max frame average brightness for HDR metadata, instead of the max brightness, as some displays do weird tonemapping if the max brightness is too high. With this change, my monitor goes from being too dim in HDR mode to exactly how it looks with HDR disabled
Edited by Xaver Hugl