From f0119ad2a70be27afabf7f87e4cc50107879d768 Mon Sep 17 00:00:00 2001 From: Ben Grater Date: Tue, 17 Jun 2025 14:56:04 -0700 Subject: [PATCH 1/3] Fixed issue with `FastSign()` on WebGL/Safari --- com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl | 2 +- com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl index 8990830ba85..29d37a82ad3 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/Colors.hlsl @@ -597,7 +597,7 @@ float3 LiftGammaGainHDR(float3 c, float3 lift, float3 invgamma, float3 gain) // ACEScg will output negative values, as clamping to 0 will lose precious information we'll // mirror the gamma function instead - return FastSign(c) * pow(abs(c), invgamma); + return sign(c) * pow(abs(c), invgamma); } // diff --git a/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl index 14c722580d8..1ede17aec75 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl @@ -116,6 +116,7 @@ float4 Max3(float4 a, float4 b, float4 c) // https://twitter.com/SebAaltonen/status/878250919879639040 // madd_sat + madd +// Incorrect result on WebGL/Safari with A17 or M3 processors. float FastSign(float x) { return saturate(x * FLT_MAX + 0.5) * 2.0 - 1.0; From 7dce7c17e46cce68da5cc269b69aceebb3093a68 Mon Sep 17 00:00:00 2001 From: Ben Grater Date: Tue, 17 Jun 2025 14:56:31 -0700 Subject: [PATCH 2/3] Update CHANGELOG --- com.unity.postprocessing/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.postprocessing/CHANGELOG.md b/com.unity.postprocessing/CHANGELOG.md index 107ff7a74c4..9e29e4da818 100644 --- a/com.unity.postprocessing/CHANGELOG.md +++ b/com.unity.postprocessing/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Remove support for PVRTC format in Unity 6.1 or newer +- Fixed issue with FastSign on WebGL/Safari (IN-71005) - Documentation updates ## [3.4.0] - 2023-12-11 From 71e1f3da0c6d009fd0a0a090953a48e6f9b0594c Mon Sep 17 00:00:00 2001 From: Ben Grater Date: Tue, 17 Jun 2025 14:59:12 -0700 Subject: [PATCH 3/3] Update CHANGELOG --- com.unity.postprocessing/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.postprocessing/CHANGELOG.md b/com.unity.postprocessing/CHANGELOG.md index 9e29e4da818..a576e7eeb45 100644 --- a/com.unity.postprocessing/CHANGELOG.md +++ b/com.unity.postprocessing/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [3.5.0] - 2025-06-12 +## [3.5.0] - 2025-06-18 ### Added - Added Switch2 platform support