From 51496c09ee7bdd1d1187631a29db0579a03b0ef5 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 10 Dec 2020 15:26:49 +0000 Subject: [PATCH 01/10] Adding support for PS5 platform. --- Tools/check-shader-includes-exclusions.txt | 1 + .../PostProcessing/Editor/Utils/EditorUtilities.cs | 1 + .../PostProcessing/Runtime/PostProcessRenderContext.cs | 2 +- com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs | 1 + com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl | 4 +++- .../Documentation~/Building-For-Consoles.md | 3 ++- .../Runtime/Debug/DebugDisplay.cs | 2 +- .../SubsurfaceScattering/SubsurfaceScatteringManager.cs | 1 + .../Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs | 2 ++ .../Runtime/RenderPipeline/Utility/HDUtils.cs | 2 ++ .../Documentation~/Building-For-Consoles.md | 3 ++- .../Runtime/RenderingUtils.cs | 2 +- .../Packages/com.unity.template.hd/Documentation~/hd.md | 2 +- .../Tests/Editor/InternalTests/ExpectedSettings.cs | 2 ++ .../Tests/Editor/InternalTests/ExpectedSettings.cs | 2 ++ 15 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Tools/check-shader-includes-exclusions.txt b/Tools/check-shader-includes-exclusions.txt index 0437b0f7bbb..310f95fa581 100644 --- a/Tools/check-shader-includes-exclusions.txt +++ b/Tools/check-shader-includes-exclusions.txt @@ -1,2 +1,3 @@ com.unity.render-pipelines.xboxone/ShaderLibrary/API/XBoxOne.hlsl com.unity.render-pipelines.ps4/ShaderLibrary/API/PSSL.hlsl +com.unity.render-pipelines.ps5/ShaderLibrary/API/PSSL.hlsl diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs index 330bff62ec0..008ee71614d 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs @@ -26,6 +26,7 @@ public static bool isTargetingConsoles { var t = EditorUserBuildSettings.activeBuildTarget; return t == BuildTarget.PS4 + || t == BuildTarget.PS5 || t == BuildTarget.XboxOne || t == BuildTarget.Switch; } diff --git a/com.unity.postprocessing/PostProcessing/Runtime/PostProcessRenderContext.cs b/com.unity.postprocessing/PostProcessing/Runtime/PostProcessRenderContext.cs index e036f813602..af37b3128de 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/PostProcessRenderContext.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/PostProcessRenderContext.cs @@ -38,7 +38,7 @@ public Camera camera stereoRenderingMode = StereoRenderingMode.MultiPass; #endif -#if UNITY_STANDALONE || UNITY_EDITOR || UNITY_PS4 +#if UNITY_STANDALONE || UNITY_EDITOR || UNITY_PS4 || UNITY_PS5 if (xrDesc.dimension == TextureDimension.Tex2DArray) stereoRenderingMode = StereoRenderingMode.SinglePassInstanced; #endif diff --git a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs index afe525c02ec..72bab51a2db 100644 --- a/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs +++ b/com.unity.render-pipelines.core/Runtime/Textures/TextureXR.cs @@ -39,6 +39,7 @@ public static bool useTexArray case GraphicsDeviceType.Direct3D11: case GraphicsDeviceType.Direct3D12: case GraphicsDeviceType.PlayStation4: + case GraphicsDeviceType.PlayStation5: case GraphicsDeviceType.Vulkan: return true; diff --git a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl index 64c414dada0..04364401387 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl @@ -160,8 +160,10 @@ // Include language header #if defined(SHADER_API_XBOXONE) #include "Packages/com.unity.render-pipelines.xboxone/ShaderLibrary/API/XBoxOne.hlsl" -#elif defined(SHADER_API_PSSL) +#elif defined(SHADER_API_PS4) #include "Packages/com.unity.render-pipelines.ps4/ShaderLibrary/API/PSSL.hlsl" +#elif defined(SHADER_API_PS5) +#include "Packages/com.unity.render-pipelines.ps5/ShaderLibrary/API/PSSL.hlsl" #elif defined(SHADER_API_D3D11) #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/API/D3D11.hlsl" #elif defined(SHADER_API_METAL) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Building-For-Consoles.md b/com.unity.render-pipelines.high-definition/Documentation~/Building-For-Consoles.md index d5b14eb45c9..4cc5e712eff 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Building-For-Consoles.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Building-For-Consoles.md @@ -1,8 +1,9 @@ # Building your Project for consoles -To build a Project for the **PlayStation 4** or **Xbox One**, you need to install an additional package for each platform you want to support. The packages for each platform are: +To build a Project for the **PlayStation 4**, **PlayStation 5** or **Xbox One**, you need to install an additional package for each platform you want to support. The packages for each platform are: - **PlayStation 4**: com.unity.render-pipelines.ps4 +- **PlayStation 5**: com.unity.render-pipelines.ps5 - **Xbox One**: com.unity.render-pipelines.xboxone ## Platform package installation diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 0c1d9ad1c59..b5345f1b240 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -309,7 +309,7 @@ internal DebugDisplaySettings() s_RenderingFullScreenDebugStrings = s_RenderingFullScreenDebugStrings.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.VertexDensity).ToArray(); s_RenderingFullScreenDebugValues = s_RenderingFullScreenDebugValues.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.VertexDensity).ToArray(); } - if (device == GraphicsDeviceType.Metal || device == GraphicsDeviceType.PlayStation4) + if (device == GraphicsDeviceType.Metal || device == GraphicsDeviceType.PlayStation4 || device == GraphicsDeviceType.PlayStation5) { s_RenderingFullScreenDebugStrings = s_RenderingFullScreenDebugStrings.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.QuadOverdraw).ToArray(); s_RenderingFullScreenDebugValues = s_RenderingFullScreenDebugValues.Where((val, idx) => (idx + FullScreenDebugMode.MinRenderingFullScreenDebug) != FullScreenDebugMode.QuadOverdraw).ToArray(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs index 3b825e4929a..993874d61ef 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs @@ -152,6 +152,7 @@ static bool NeedTemporarySubsurfaceBuffer() // Most modern GPUs support it. We can avoid performing a costly copy in this case. // TODO: test/implement for other platforms. return (SystemInfo.graphicsDeviceType != GraphicsDeviceType.PlayStation4 && + SystemInfo.graphicsDeviceType != GraphicsDeviceType.PlayStation5 && SystemInfo.graphicsDeviceType != GraphicsDeviceType.XboxOne && SystemInfo.graphicsDeviceType != GraphicsDeviceType.XboxOneD3D12); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index db35bb9d297..0ce12fb39c2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -248,6 +248,7 @@ PrepassOutput RenderPrepass(RenderGraph renderGraph, // Only on consoles is safe to read and write from/to the depth atlas bool mip1FromDownsampleForLowResTrans = SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation4 || + SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation5 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.XboxOne || SystemInfo.graphicsDeviceType == GraphicsDeviceType.XboxOneD3D12; mip1FromDownsampleForLowResTrans = mip1FromDownsampleForLowResTrans && hdCamera.frameSettings.IsEnabled(FrameSettingsField.LowResTransparent); @@ -806,6 +807,7 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec } bool canReadBoundDepthBuffer = SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation4 || + SystemInfo.graphicsDeviceType == GraphicsDeviceType.PlayStation5 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.XboxOne || SystemInfo.graphicsDeviceType == GraphicsDeviceType.XboxOneD3D12; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs index 3d190230265..8a99e2587ab 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Utility/HDUtils.cs @@ -715,6 +715,7 @@ internal static bool IsSupportedGraphicDevice(GraphicsDeviceType graphicDevice) return (graphicDevice == GraphicsDeviceType.Direct3D11 || graphicDevice == GraphicsDeviceType.Direct3D12 || graphicDevice == GraphicsDeviceType.PlayStation4 || + graphicDevice == GraphicsDeviceType.PlayStation5 || graphicDevice == GraphicsDeviceType.XboxOne || graphicDevice == GraphicsDeviceType.XboxOneD3D12 || graphicDevice == GraphicsDeviceType.Metal || @@ -735,6 +736,7 @@ internal static bool IsSupportedBuildTarget(UnityEditor.BuildTarget buildTarget) buildTarget == UnityEditor.BuildTarget.WSAPlayer || buildTarget == UnityEditor.BuildTarget.XboxOne || buildTarget == UnityEditor.BuildTarget.PS4 || + buildTarget == UnityEditor.BuildTarget.PS5 || // buildTarget == UnityEditor.BuildTarget.iOS || // IOS isn't supported // buildTarget == UnityEditor.BuildTarget.Switch || // Switch isn't supported buildTarget == UnityEditor.BuildTarget.CloudRendering); diff --git a/com.unity.render-pipelines.universal/Documentation~/Building-For-Consoles.md b/com.unity.render-pipelines.universal/Documentation~/Building-For-Consoles.md index d5b14eb45c9..4cc5e712eff 100644 --- a/com.unity.render-pipelines.universal/Documentation~/Building-For-Consoles.md +++ b/com.unity.render-pipelines.universal/Documentation~/Building-For-Consoles.md @@ -1,8 +1,9 @@ # Building your Project for consoles -To build a Project for the **PlayStation 4** or **Xbox One**, you need to install an additional package for each platform you want to support. The packages for each platform are: +To build a Project for the **PlayStation 4**, **PlayStation 5** or **Xbox One**, you need to install an additional package for each platform you want to support. The packages for each platform are: - **PlayStation 4**: com.unity.render-pipelines.ps4 +- **PlayStation 5**: com.unity.render-pipelines.ps5 - **Xbox One**: com.unity.render-pipelines.xboxone ## Platform package installation diff --git a/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs b/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs index 5f4ba45aa51..5fdf6f3c522 100644 --- a/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs +++ b/com.unity.render-pipelines.universal/Runtime/RenderingUtils.cs @@ -73,7 +73,7 @@ internal static bool useStructuredBuffer //GraphicsDeviceType deviceType = SystemInfo.graphicsDeviceType; //return !Application.isMobilePlatform && // (deviceType == GraphicsDeviceType.Metal || deviceType == GraphicsDeviceType.Vulkan || - // deviceType == GraphicsDeviceType.PlayStation4 || deviceType == GraphicsDeviceType.XboxOne); + // deviceType == GraphicsDeviceType.PlayStation4 || deviceType == GraphicsDeviceType.PlayStation5 || deviceType == GraphicsDeviceType.XboxOne); } } diff --git a/com.unity.template-hd/Packages/com.unity.template.hd/Documentation~/hd.md b/com.unity.template-hd/Packages/com.unity.template.hd/Documentation~/hd.md index 7498592e2fb..e3f1e9511fe 100644 --- a/com.unity.template-hd/Packages/com.unity.template.hd/Documentation~/hd.md +++ b/com.unity.template-hd/Packages/com.unity.template.hd/Documentation~/hd.md @@ -14,7 +14,7 @@ This Project Template uses the following features: This Template utilizes the High Definition Render Pipeline. -The High-Definition Render Pipeline prioritizes stunning, high-fidelity visuals and is intended for high-end hardware: GPU-compute-capable consoles, and PC hardware (DX11 and above, Xbox One, PS4, Metal (macOS), +The High-Definition Render Pipeline prioritizes stunning, high-fidelity visuals and is intended for high-end hardware: GPU-compute-capable consoles, and PC hardware (DX11 and above, Xbox One, PS4, PS5, Metal (macOS), and Vulkan (PC)). Because this Template was created to deliver great visuals the render pipeline asset, project, lighting, and post-processing settings have been tuned with a high-end experience in mind. This makes it a great starting point diff --git a/com.unity.template-hd/Packages/com.unity.template.hd/Tests/Editor/InternalTests/ExpectedSettings.cs b/com.unity.template-hd/Packages/com.unity.template.hd/Tests/Editor/InternalTests/ExpectedSettings.cs index e73ef70b529..08e1bb6856e 100644 --- a/com.unity.template-hd/Packages/com.unity.template.hd/Tests/Editor/InternalTests/ExpectedSettings.cs +++ b/com.unity.template-hd/Packages/com.unity.template.hd/Tests/Editor/InternalTests/ExpectedSettings.cs @@ -18,6 +18,7 @@ static IEnumerable GraphicsJobsValidBuildTargets yield return new TestCaseData(BuildTarget.iOS); yield return new TestCaseData(BuildTarget.Lumin); yield return new TestCaseData(BuildTarget.PS4); + yield return new TestCaseData(BuildTarget.PS5); yield return new TestCaseData(BuildTarget.Stadia); yield return new TestCaseData(BuildTarget.StandaloneLinux64); yield return new TestCaseData(BuildTarget.StandaloneOSX); @@ -43,6 +44,7 @@ private static bool GraphicsJobsEnabledByDefault(BuildTarget buildTarget) case BuildTarget.WebGL: return false; case BuildTarget.PS4: + case BuildTarget.PS5: case BuildTarget.Stadia: case BuildTarget.StandaloneLinux64: case BuildTarget.StandaloneWindows: diff --git a/com.unity.template-universal/Packages/com.unity.template.universal/Tests/Editor/InternalTests/ExpectedSettings.cs b/com.unity.template-universal/Packages/com.unity.template.universal/Tests/Editor/InternalTests/ExpectedSettings.cs index 6b994735ce9..51eb8a269f1 100644 --- a/com.unity.template-universal/Packages/com.unity.template.universal/Tests/Editor/InternalTests/ExpectedSettings.cs +++ b/com.unity.template-universal/Packages/com.unity.template.universal/Tests/Editor/InternalTests/ExpectedSettings.cs @@ -18,6 +18,7 @@ static IEnumerable GraphicsJobsValidBuildTargets yield return new TestCaseData(BuildTarget.iOS); yield return new TestCaseData(BuildTarget.Lumin); yield return new TestCaseData(BuildTarget.PS4); + yield return new TestCaseData(BuildTarget.PS5); yield return new TestCaseData(BuildTarget.Stadia); yield return new TestCaseData(BuildTarget.StandaloneLinux64); yield return new TestCaseData(BuildTarget.StandaloneOSX); @@ -43,6 +44,7 @@ private static bool GraphicsJobsEnabledByDefault(BuildTarget buildTarget) case BuildTarget.WebGL: return false; case BuildTarget.PS4: + case BuildTarget.PS5: case BuildTarget.Stadia: case BuildTarget.StandaloneLinux64: case BuildTarget.StandaloneWindows: From b2ab77fad3df743e11c34ee6a7711fdc7cf1b381 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 16 Dec 2020 16:04:16 +0000 Subject: [PATCH 02/10] Updating CHANGELOGs with PS5 support addition. --- com.unity.postprocessing/CHANGELOG.md | 3 +++ com.unity.render-pipelines.core/CHANGELOG.md | 3 +++ com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + com.unity.render-pipelines.universal/CHANGELOG.md | 1 + 4 files changed, 8 insertions(+) diff --git a/com.unity.postprocessing/CHANGELOG.md b/com.unity.postprocessing/CHANGELOG.md index 845aac393c9..599660ecd93 100644 --- a/com.unity.postprocessing/CHANGELOG.md +++ b/com.unity.postprocessing/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [3.0.2] - XXXX-XX-XX +### Added +- Support for the PlayStation 5 platform has been added. + ### Changed - ResetProjection isn't being called anymore if Temporal Anti-aliasing isn't enabled, allowing the use of custom projection matrices. diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index c79af6b0010..afd5e261fe7 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Added +- Support for the PlayStation 5 platform has been added. + ## [10.2.0] - 2020-10-19 Version Updated diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7fc7a8cbfc7..53dfa17badb 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added a new API to bake HDRP probes from C# (case 1276360) - Added support for pre-exposure for planar reflections. - Added support for nested volume components to volume system. +- Support for the PlayStation 5 platform has been added. ### Fixed - Fixed probe volumes debug views. diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 7567a4f5cbd..ca3cb2d7a4a 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [11.0.0] - 2020-10-21 ### Added - Added real-time Point Light Shadows. +- Support for the PlayStation 5 platform has been added. ### Added - Added a supported MSAA samples count check, so the actual supported MSAA samples count value can be assigned to RenderTexture descriptors. From 6f31250d2639659f4329182d6268f8a50cdcea80 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 11 Jan 2021 17:22:49 +0000 Subject: [PATCH 03/10] Fix PS5 not being in the buildtarget enum for all versions of Unity that PPV2 supports. --- .../PostProcessing/Editor/Utils/EditorUtilities.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs index 008ee71614d..fcc07dea005 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs @@ -26,7 +26,9 @@ public static bool isTargetingConsoles { var t = EditorUserBuildSettings.activeBuildTarget; return t == BuildTarget.PS4 +#if UNITY_PS5 || t == BuildTarget.PS5 +#endif || t == BuildTarget.XboxOne || t == BuildTarget.Switch; } From e88e7760ccbc1516e5dcbe220dda4abc94c523db Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 12 Jan 2021 09:56:45 +0000 Subject: [PATCH 04/10] Remove old code that is nolonger needed. --- .../PostProcessing/Shaders/API/PSSL.hlsl | 2 +- .../Runtime/Lighting/LightLoop/ShaderBase.hlsl | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl index ef3eafb6b4b..ca2a56fb990 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl @@ -43,7 +43,7 @@ #define UNITY_LOOP [loop] #define UNITY_FASTOPT [fastopt] -#define CBUFFER_START(name) ConstantBuffer name { +#define CBUFFER_START(name) cbuffer name { #define CBUFFER_END }; #if UNITY_GATHER_SUPPORTED diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ShaderBase.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ShaderBase.hlsl index 3d16077fe2e..01222c07673 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ShaderBase.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/ShaderBase.hlsl @@ -4,20 +4,6 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/TextureXR.hlsl" -#ifdef SHADER_API_PSSL - #ifndef Texture2DMS - #define Texture2DMS MS_Texture2D - #endif - - #ifndef SampleCmpLevelZero - #define SampleCmpLevelZero SampleCmpLOD0 - #endif - - #ifndef firstbithigh - #define firstbithigh FirstSetBit_Hi - #endif -#endif - #ifdef MSAA_ENABLED TEXTURE2D_X_MSAA(float, g_depth_tex) : register( t0 ); From 234249c7f46e1b92dfbb169dd2c957d888804064 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 12 Jan 2021 09:57:37 +0000 Subject: [PATCH 05/10] The optimizer will take the standard Min3 and Max3 functions and produce optimal results so we don't need this anymore. --- .../PostProcessing/Shaders/API/PSSL.hlsl | 3 --- .../Shaders/Builtins/ScreenSpaceReflections.hlsl | 12 +++--------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl index ca2a56fb990..1982bcb3616 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/API/PSSL.hlsl @@ -2,9 +2,6 @@ #define UNITY_REVERSED_Z 1 #define UNITY_GATHER_SUPPORTED (SHADER_TARGET >= 50) #define UNITY_CAN_READ_POSITION_IN_FRAGMENT_PROGRAM 1 -#define INTRINSIC_MINMAX3 -#define Min3 min3 -#define Max3 max3 #define TEXTURE2D_SAMPLER2D(textureName, samplerName) Texture2D textureName; SamplerState samplerName #define TEXTURE3D_SAMPLER3D(textureName, samplerName) Texture3D textureName; SamplerState samplerName diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl index 90a967c4256..7e45dc51734 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl @@ -327,15 +327,9 @@ float4 FragReproject(VaryingsDefault i) : SV_Target _MainTex.SampleLevel(sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + float2( k.x, k.y)), 0) ); - // PS4 INTRINSIC_MINMAX3 - #if SHADER_API_PSSL - float4 minimum = min3(min3(min3(min3(top[0], top[1], top[2]), top[3], bottom[0]), bottom[1], bottom[2]), bottom[3], color); - float4 maximum = max3(max3(max3(max3(top[0], top[1], top[2]), top[3], bottom[0]), bottom[1], bottom[2]), bottom[3], color); - #else - float4 minimum = min(min(min(min(min(min(min(min(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); - float4 maximum = max(max(max(max(max(max(max(max(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); - #endif - + float4 minimum = min(min(min(min(min(min(min(min(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); + float4 maximum = max(max(max(max(max(max(max(max(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); + float4 history = _History.SampleLevel(sampler_History, UnityStereoTransformScreenSpaceTex(uv), 0); history = clamp(history, minimum, maximum); From 8998567c205955c0d38508a7b382029ef126c313 Mon Sep 17 00:00:00 2001 From: Martin Thorzen <35328557+martint-unity@users.noreply.github.com> Date: Fri, 15 Jan 2021 09:46:58 +0100 Subject: [PATCH 06/10] filter for xbone addded (#3116) --- .../Test/TestFilters/TestCaseFilters.asset | 131 ++++++++++-------- 1 file changed, 70 insertions(+), 61 deletions(-) diff --git a/TestProjects/UniversalGraphicsTest/Assets/Test/TestFilters/TestCaseFilters.asset b/TestProjects/UniversalGraphicsTest/Assets/Test/TestFilters/TestCaseFilters.asset index 5d90301598d..05bf0815090 100644 --- a/TestProjects/UniversalGraphicsTest/Assets/Test/TestFilters/TestCaseFilters.asset +++ b/TestProjects/UniversalGraphicsTest/Assets/Test/TestFilters/TestCaseFilters.asset @@ -107,20 +107,20 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: bcb8635ea84c143f0ae0823f1e9b6f25, type: 3} ColorSpace: -1 - BuildPlatform: 9 - GraphicsDevice: 16 - XrSdk: None + BuildPlatform: 19 + GraphicsDevice: 21 + XrSdk: StereoModes: 0 - Reason: 'Filtered out due to OoM issue (FB: 1304672)' + Reason: https://fogbugz.unity3d.com/f/cases/1305591/ - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: bcb8635ea84c143f0ae0823f1e9b6f25, type: 3} ColorSpace: -1 - BuildPlatform: 19 - GraphicsDevice: 21 - XrSdk: + BuildPlatform: 9 + GraphicsDevice: 16 + XrSdk: None StereoModes: 0 - Reason: https://fogbugz.unity3d.com/f/cases/1305591/ + Reason: 'Filtered out due to OoM issue (FB: 1304672)' - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 2d287b701f8e1bf429c14805ac505eb9, type: 3} @@ -161,44 +161,44 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 31 - GraphicsDevice: 13 - XrSdk: + BuildPlatform: -2 + GraphicsDevice: 17 + XrSdk: None StereoModes: 0 - Reason: https://fogbugz.unity3d.com/f/cases/1304675 + Reason: Needs fixing in OpenGL - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 5 - GraphicsDevice: 21 - XrSdk: None + BuildPlatform: 33 + GraphicsDevice: 23 + XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 13 - GraphicsDevice: 11 + BuildPlatform: 9 + GraphicsDevice: 16 XrSdk: None StereoModes: 0 - Reason: https://fogbugz.unity3d.com/f/cases/1304675 + Reason: 'Filtered out due to OoM issue (FB: 1304672)' - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 13 - GraphicsDevice: 21 - XrSdk: None + BuildPlatform: 38 + GraphicsDevice: 22 + XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 24 - GraphicsDevice: 21 + BuildPlatform: 19 + GraphicsDevice: 2 XrSdk: None StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 @@ -206,17 +206,17 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 5 + BuildPlatform: 19 GraphicsDevice: 18 - XrSdk: None + XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 19 - GraphicsDevice: 21 + BuildPlatform: 33 + GraphicsDevice: 14 XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 @@ -224,17 +224,17 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 19 + BuildPlatform: 5 GraphicsDevice: 18 - XrSdk: + XrSdk: None StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 19 - GraphicsDevice: 2 + BuildPlatform: 24 + GraphicsDevice: 21 XrSdk: None StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 @@ -242,26 +242,35 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 38 - GraphicsDevice: 22 - XrSdk: + BuildPlatform: 13 + GraphicsDevice: 21 + XrSdk: None StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 9 - GraphicsDevice: 16 + BuildPlatform: 13 + GraphicsDevice: 11 XrSdk: None StereoModes: 0 - Reason: 'Filtered out due to OoM issue (FB: 1304672)' + Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: 33 - GraphicsDevice: 23 + BuildPlatform: 5 + GraphicsDevice: 21 + XrSdk: None + StereoModes: 0 + Reason: https://fogbugz.unity3d.com/f/cases/1304675 + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} + ColorSpace: -1 + BuildPlatform: 31 + GraphicsDevice: 13 XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1304675 @@ -269,11 +278,11 @@ MonoBehaviour: FilteredScenes: - {fileID: 102900000, guid: 770b86964e87d47e4bdbafa425ccd238, type: 3} ColorSpace: -1 - BuildPlatform: -2 - GraphicsDevice: 17 - XrSdk: None + BuildPlatform: 19 + GraphicsDevice: 21 + XrSdk: StereoModes: 0 - Reason: Needs fixing in OpenGL + Reason: https://fogbugz.unity3d.com/f/cases/1304675 - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 7a8ef7ce062f0465b9e493dd5730cecb, type: 3} @@ -455,15 +464,6 @@ MonoBehaviour: XrSdk: None StereoModes: 0 Reason: Needs fixing in OpenGL - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: 83adeebeb3ba74a13816f2b8636588aa, type: 3} - ColorSpace: -1 - BuildPlatform: 24 - GraphicsDevice: 21 - XrSdk: None - StereoModes: 0 - Reason: https://fogbugz.unity3d.com/f/cases/1305639/ - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 83adeebeb3ba74a13816f2b8636588aa, type: 3} @@ -482,6 +482,15 @@ MonoBehaviour: XrSdk: StereoModes: 0 Reason: https://fogbugz.unity3d.com/f/cases/1293775/ + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: 83adeebeb3ba74a13816f2b8636588aa, type: 3} + ColorSpace: -1 + BuildPlatform: 24 + GraphicsDevice: 21 + XrSdk: None + StereoModes: 0 + Reason: https://fogbugz.unity3d.com/f/cases/1305639/ - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: c7b61419ee9382545afe530714fda0c2, type: 3} @@ -572,6 +581,15 @@ MonoBehaviour: XrSdk: None StereoModes: 0 Reason: OSX Standalone won't work with back buffer capture + - FilteredScene: {fileID: 0} + FilteredScenes: + - {fileID: 102900000, guid: 9173c5ffc1365594aa9b927c4cd84c54, type: 3} + ColorSpace: -1 + BuildPlatform: -2 + GraphicsDevice: 17 + XrSdk: None + StereoModes: 0 + Reason: Needs fixing in OpenGL - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: 9173c5ffc1365594aa9b927c4cd84c54, type: 3} @@ -590,15 +608,6 @@ MonoBehaviour: XrSdk: None StereoModes: 0 Reason: OSX Standalone won't work with back buffer capture - - FilteredScene: {fileID: 0} - FilteredScenes: - - {fileID: 102900000, guid: 9173c5ffc1365594aa9b927c4cd84c54, type: 3} - ColorSpace: -1 - BuildPlatform: -2 - GraphicsDevice: 17 - XrSdk: None - StereoModes: 0 - Reason: Needs fixing in OpenGL - FilteredScene: {fileID: 0} FilteredScenes: - {fileID: 102900000, guid: d66b74ae4e7264d62bdb2c4f56261030, type: 3} From ee09a0292ef11cec91cc38f33a5ccfa20f8b1866 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 18 Jan 2021 14:04:36 +0000 Subject: [PATCH 07/10] Updated the PS5 CHANGELOG entries to be for the correct version. --- com.unity.render-pipelines.core/CHANGELOG.md | 6 +++--- com.unity.render-pipelines.universal/CHANGELOG.md | 4 +++- .../Packages/com.unity.template.hd/CHANGELOG.md | 3 +++ .../Packages/com.unity.template.universal/CHANGELOG.md | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 3bd21f56772..66bf85ffd6b 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Added +- Support for the PlayStation 5 platform has been added. + ## [11.0.0] - 2020-10-21 ### Fixed @@ -22,9 +25,6 @@ The version number for this package has increased due to a version update of a r - New View Lighting Tool, a component which allow to setup light in the camera space - New function in GeometryTools.hlsl to calculate triangle edge and full triangle culling. -### Added -- Support for the PlayStation 5 platform has been added. - ## [10.2.0] - 2020-10-19 Version Updated diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index bbf20ec745d..33ed852b9b1 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 +### Added +- Added support for the PlayStation 5 platform. + ### Fixed - Fixed an issue where render scale was breaking SSAO in scene view. [case 1296710](https://issuetracker.unity3d.com/issues/ssao-effect-floating-in-the-air-in-scene-view-when-2-objects-with-shadergraph-materials-are-on-top-of-each-other) - Fixed GC allocations from XR occlusion mesh when using multipass. @@ -22,7 +25,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added an option to use faster, but less accurate approximation functions when converting between the sRGB and Linear color spaces. - Added screen space shadow as renderer feature - Added [DisallowMultipleRendererFeature] attribute for Renderer Features. -- Added support for the PlayStation 5 platform. ### Changed - Optimized 2D Renderer performance on mobile GPUs by reducing the number of render target switches. diff --git a/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md b/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md index db27a15cde0..e08c986be65 100644 --- a/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md +++ b/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 +### Added +- Support for the PlayStation 5 platform has been added. + ### Changed - Update SRP package to 12.0.0 diff --git a/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md b/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md index c1debd53974..2cd23195295 100644 --- a/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md +++ b/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 +### Added +- Support for the PlayStation 5 platform has been added. + ### Changed - Update SRP package to 12.0.0 From 448859b62c7dccdb481d3d3227744937e9543570 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 18 Jan 2021 16:59:17 +0000 Subject: [PATCH 08/10] Formatting fixup --- .../PostProcessing/Editor/Utils/EditorUtilities.cs | 2 +- .../PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs index fcc07dea005..0ccbced44ae 100644 --- a/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs +++ b/com.unity.postprocessing/PostProcessing/Editor/Utils/EditorUtilities.cs @@ -26,7 +26,7 @@ public static bool isTargetingConsoles { var t = EditorUserBuildSettings.activeBuildTarget; return t == BuildTarget.PS4 -#if UNITY_PS5 +#if UNITY_PS5 || t == BuildTarget.PS5 #endif || t == BuildTarget.XboxOne diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl index 7e45dc51734..9a44e53ea00 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl +++ b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl @@ -329,7 +329,7 @@ float4 FragReproject(VaryingsDefault i) : SV_Target float4 minimum = min(min(min(min(min(min(min(min(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); float4 maximum = max(max(max(max(max(max(max(max(top[0], top[1]), top[2]), top[3]), bottom[0]), bottom[1]), bottom[2]), bottom[3]), color); - + float4 history = _History.SampleLevel(sampler_History, UnityStereoTransformScreenSpaceTex(uv), 0); history = clamp(history, minimum, maximum); From ea0aa4f26c2e2b47ec7745e406d68f38e362de19 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Tue, 19 Jan 2021 17:01:43 +0100 Subject: [PATCH 09/10] Update CHANGELOG.md --- .../Packages/com.unity.template.hd/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md b/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md index 9467aff7ea8..59544caca2d 100644 --- a/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md +++ b/com.unity.template-hd/Packages/com.unity.template.hd/CHANGELOG.md @@ -6,9 +6,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 -### Added -- Support for the PlayStation 5 platform has been added. - ### Changed - Update SRP package to 12.0.0 From 40a6e644a87c0f383c6552d7a1581e8322d571f8 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Tue, 19 Jan 2021 17:02:10 +0100 Subject: [PATCH 10/10] Update CHANGELOG.md --- .../Packages/com.unity.template.universal/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md b/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md index 357def12ea9..aa4c3f62ea5 100644 --- a/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md +++ b/com.unity.template-universal/Packages/com.unity.template.universal/CHANGELOG.md @@ -6,9 +6,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [12.0.0] - 2021-01-11 -### Added -- Support for the PlayStation 5 platform has been added. - ### Changed - Update SRP package to 12.0.0