Skip to content

Commit 6a02f0e

Browse files
[PPV2] PPB-61 Fixed issue with FastSign() on WebGL/Safari (#8171)
* Fixed issue with `FastSign()` on WebGL/Safari * Update CHANGELOG * Update CHANGELOG --------- Co-authored-by: Théo Penavaire <[email protected]>
1 parent 0c7b706 commit 6a02f0e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

com.unity.postprocessing/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ All notable changes to this package will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [3.5.0] - 2025-06-12
7+
## [3.5.0] - 2025-06-18
88

99
### Added
1010
- Added Switch2 platform support
1111

1212
### Fixed
1313
- Remove support for PVRTC format in Unity 6.1 or newer
14+
- Fixed issue with FastSign on WebGL/Safari (IN-71005)
1415
- Fixed compute based effects not supported on OpenGLES
1516
- Documentation updates
1617

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)