From cdea0b13f8ab12ac0bf1ff8669f2157f477c5100 Mon Sep 17 00:00:00 2001 From: Kay-Leng Chang Date: Fri, 13 Oct 2023 23:29:41 +0000 Subject: [PATCH] Re-enabled 009-SG-FullScreenTarget test scene for PS5 https://jira.unity3d.com/browse/UUM-38845 Re-enabled 009-SG-FullScreenTarget from HDRP_RuntimeTest for PS5. The original artefact that caused the test to be disabled on PS5 did not reproduce anymore. Instead a new bug appeared which is related to the computation of noise values on PS5. The PSSL shader compiler was unhappy to divide by float(0xFFFFFFFF), and failed to generate any noise pattern. The workaround is to replace float(0xFFFFFFFF) by float(0x00FFFFFF), which is the maximal continuous integer value that can be represented as a float (mantissa is 24 bits). After 009-SG-FullScreenTarget has been re-enabled, 010-BRG-Simple became an instability on NGGC only and has been disabled (upload of instanced color data in GraphicsBuffer not always fully synced when GPU access it). A separate Jira ticket has been opened to fix the later: https://jira.unity3d.com/browse/PLATGRAPH-2249. --- .../ShaderLibrary/Hashes.hlsl | 20 +++++++++---------- .../Tests/TestFilters/TestCaseFilters.asset | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl index 22be088490b..9d4cdbda660 100644 --- a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl +++ b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Hashes.hlsl @@ -14,7 +14,7 @@ void Hash_Tchou_2_1_float(float2 i, out float o) uint r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_1_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_2_1_half(half2 i, out half o) @@ -22,7 +22,7 @@ void Hash_Tchou_2_1_half(half2 i, out half o) uint r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_1_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_2_3_uint(uint2 q, out uint3 o) @@ -45,7 +45,7 @@ void Hash_Tchou_2_3_float(float2 i, out float3 o) uint3 r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_3_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_2_3_half(half2 i, out half3 o) @@ -53,7 +53,7 @@ void Hash_Tchou_2_3_half(half2 i, out half3 o) uint3 r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_3_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_2_2_uint(uint2 v, out uint2 o) @@ -73,7 +73,7 @@ void Hash_Tchou_2_2_float(float2 i, out float2 o) uint2 r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_2_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_2_2_half(half2 i, out half2 o) @@ -81,7 +81,7 @@ void Hash_Tchou_2_2_half(half2 i, out half2 o) uint2 r; uint2 v = (uint2) (int2) round(i); Hash_Tchou_2_2_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_3_1_uint(uint3 v, out uint o) @@ -102,7 +102,7 @@ void Hash_Tchou_3_1_float(float3 i, out float o) uint r; uint3 v = (uint3) (int3) round(i); Hash_Tchou_3_1_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_3_1_half(half3 i, out half o) @@ -110,7 +110,7 @@ void Hash_Tchou_3_1_half(half3 i, out half o) uint r; uint3 v = (uint3) (int3) round(i); Hash_Tchou_3_1_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_3_3_uint(uint3 v, out uint3 o) @@ -132,14 +132,14 @@ void Hash_Tchou_3_3_float(float3 i, out float3 o) { uint3 r, v = (uint3) (int3) round(i); Hash_Tchou_3_3_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_Tchou_3_3_half(half3 i, out half3 o) { uint3 r, v = (uint3) (int3) round(i); Hash_Tchou_3_3_uint(v, r); - o = r * (1.0 / float(0xffffffff)); + o = (r >> 8) * (1.0 / float(0x00ffffff)); } void Hash_LegacySine_2_1_float(float2 i, out float o) diff --git a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/TestFilters/TestCaseFilters.asset b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/TestFilters/TestCaseFilters.asset index 7107fca6708..e2c5dbbdb85 100644 --- a/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/TestFilters/TestCaseFilters.asset +++ b/Tests/SRPTests/Projects/HDRP_RuntimeTests/Assets/Tests/TestFilters/TestCaseFilters.asset @@ -69,10 +69,10 @@ MonoBehaviour: Reason: https://jira.unity3d.com/browse/UUM-41066 - FilteredScene: {fileID: 0} FilteredScenes: - - {fileID: 102900000, guid: acfbd4f5585803d45830318a74d9d4d0, type: 3} + - {fileID: 102900000, guid: 867317546bead5244b025a134b2edec2, type: 3} ColorSpace: -1 BuildPlatform: 44 GraphicsDevice: 4 XrSdk: StereoModes: 0 - Reason: https://jira.unity3d.com/browse/UUM-22395 \ No newline at end of file + Reason: https://jira.unity3d.com/browse/PLATGRAPH-2249