Skip to content

Commit f0119ad

Browse files
Fixed issue with FastSign() on WebGL/Safari
1 parent 24518e2 commit f0119ad

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ float3 LiftGammaGainHDR(float3 c, float3 lift, float3 invgamma, float3 gain)
597597

598598
// ACEScg will output negative values, as clamping to 0 will lose precious information we'll
599599
// mirror the gamma function instead
600-
return FastSign(c) * pow(abs(c), invgamma);
600+
return sign(c) * pow(abs(c), invgamma);
601601
}
602602

603603
//

com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ float4 Max3(float4 a, float4 b, float4 c)
116116

117117
// https://twitter.com/SebAaltonen/status/878250919879639040
118118
// madd_sat + madd
119+
// Incorrect result on WebGL/Safari with A17 or M3 processors.
119120
float FastSign(float x)
120121
{
121122
return saturate(x * FLT_MAX + 0.5) * 2.0 - 1.0;

0 commit comments

Comments
 (0)