From 393e5f9f32c5179230fe897e67ce5e873a4b5595 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 2 Mar 2021 11:48:28 +0100 Subject: [PATCH] [PPv2] Fixes for Mobile & WebGL platforms (#3720) * Fix for compilation error in the FinalPass shader with GLES2/WebGL1 (case 1311160) * Fix for MSVO errors on unsupported Android platforms (case 1316915) * Version update * Version update (back to 3.1.0, not published yet) --- com.unity.postprocessing/CHANGELOG.md | 4 +++- .../PostProcessing/Runtime/Effects/AmbientOcclusion.cs | 7 ++++--- .../PostProcessing/Shaders/Builtins/FinalPass.shader | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/com.unity.postprocessing/CHANGELOG.md b/com.unity.postprocessing/CHANGELOG.md index 41cb117cdbe..b69eb365012 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.1.0] - 2021-02-20 +## [3.1.0] - 2021-03-02 ### Added - Support for the PlayStation 5 platform has been added. @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fix for issue thrown upon unloading a scene from an AssetBundle (case 1262826) - Fix for MSVO when used with dynamic resolution reallocating temporary render targets whenever the dynamic resolution scale was changed which could cause a higher peak VRAM usage and fragmentation (Case 1285605). Temporary targets will now use dynamic scaling as well to solve this. Please note there is a bug in Unity that breaks this fix (case 1285577) To make use of dynamic resolution and MSVO please use Unity 2019.4.19f1, 2020.2.2f1, 2021.1.0a9 or later. +- Fix for compilation error in the FinalPass shader with GLES2/WebGL1 (case 1311160) +- Fix for MSVO errors on unsupported Android platforms (case 1316915) ## [3.0.3] - 2021-02-19 diff --git a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs index 93f83cc17a6..c2dcc7ba7a3 100644 --- a/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs +++ b/com.unity.postprocessing/PostProcessing/Runtime/Effects/AmbientOcclusion.cs @@ -1,4 +1,5 @@ using System; +using UnityEngine.Experimental.Rendering; namespace UnityEngine.Rendering.PostProcessing { @@ -189,9 +190,9 @@ public override bool IsEnabledAndSupported(PostProcessRenderContext context) state &= SystemInfo.supportsComputeShaders && !RuntimeUtilities.isAndroidOpenGL - && RenderTextureFormat.RFloat.IsSupported() - && RenderTextureFormat.RHalf.IsSupported() - && RenderTextureFormat.R8.IsSupported(); + && SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, FormatUsage.Render | FormatUsage.LoadStore) + && SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, FormatUsage.Render | FormatUsage.LoadStore) + && SystemInfo.IsFormatSupported(GraphicsFormat.R8_UNorm, FormatUsage.Render | FormatUsage.LoadStore); } return state; diff --git a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/FinalPass.shader b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/FinalPass.shader index 3c8e66ffb95..879b7f71670 100644 --- a/com.unity.postprocessing/PostProcessing/Shaders/Builtins/FinalPass.shader +++ b/com.unity.postprocessing/PostProcessing/Shaders/Builtins/FinalPass.shader @@ -131,10 +131,10 @@ Shader "Hidden/PostProcessing/FinalPass" Pass { HLSLPROGRAM - #pragma only_renderers gles + #pragma only_renderers gles3 #pragma multi_compile __ STEREO_INSTANCING_ENABLED STEREO_DOUBLEWIDE_TARGET - #pragma target es3.0 + #pragma target 3.0 ENDHLSL }