renderer/cm: allow gamma 2.2 instead of sRGB EOTF (#12094)

This commit is contained in:
Dominick DiMaggio 2025-10-29 08:53:42 -04:00 committed by GitHub
parent ce9787b3f4
commit ff50dc36e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 51 additions and 15 deletions

View file

@ -416,7 +416,7 @@ vec4 doColorManagement(vec4 pixColor, int srcTF, int dstTF, mat4x2 dstPrimaries)
mat3 dstxyz = primaries2xyz(dstPrimaries);
pixColor = tonemap(pixColor, dstxyz);
pixColor = fromLinearNit(pixColor, dstTF, dstTFRange);
if (srcTF == CM_TRANSFER_FUNCTION_SRGB && dstTF == CM_TRANSFER_FUNCTION_ST2084_PQ) {
if ((srcTF == CM_TRANSFER_FUNCTION_SRGB || srcTF == CM_TRANSFER_FUNCTION_GAMMA22) && dstTF == CM_TRANSFER_FUNCTION_ST2084_PQ) {
pixColor = saturate(pixColor, dstxyz, sdrSaturation);
pixColor.rgb *= sdrBrightnessMultiplier;
}