From f8f6c8fd7c86355dfc4795f3c01928e830c5ac15 Mon Sep 17 00:00:00 2001 From: martint-unity Date: Fri, 15 May 2020 11:09:11 +0200 Subject: [PATCH 1/3] [7.x.x] backport #411 Additionally fix selecting GLES3 api in Windows Editor. --- com.unity.render-pipelines.universal/CHANGELOG.md | 1 + .../Runtime/UniversalRenderPipeline.cs | 3 ++- com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 1c21edc44b5..5882a054c0b 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed UI text of RenderObjects feature to display LightMode tag instead of Shader Pass Name. [case 1201696](https://issuetracker.unity3d.com/issues/render-feature-slash-pass-ui-has-a-field-for-shader-pass-name-when-it-actually-expects-shader-pass-lightmode) - Fixed an issue that caused memory allocations when sorting cameras. [case 1226448](https://issuetracker.unity3d.com/issues/2d-renderer-using-more-than-one-camera-that-renders-out-to-a-render-texture-creates-gc-alloc-every-frame) - Fixed an issue that caused the inverse view and projection matrix to output wrong values in some platforms. [case 1243990](https://issuetracker.unity3d.com/issues/urp-8-dot-1-breaks-unity-matrix-i-vp) +- Fixed GLES shaders compilation failing on Windows platform (not a mobile platform) due to uniform count limit. ## [7.3.0] - 2020-03-11 diff --git a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs index 25c59299670..3f9aa3ae673 100644 --- a/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs +++ b/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs @@ -73,7 +73,8 @@ public static int maxVisibleAdditionalLights { get { - return (Application.isMobilePlatform || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLCore) + // GLES can be selected as platform on Windows (not a mobile platform) but uniform buffer size so we must use a low light count. + return (Application.isMobilePlatform || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLCore || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES2 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3) ? k_MaxVisibleAdditionalLightsMobile : k_MaxVisibleAdditionalLightsNonMobile; } } diff --git a/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl b/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl index e5dea98562c..e7a1645375e 100644 --- a/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl +++ b/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl @@ -7,7 +7,7 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderTypes.cs.hlsl" -#if defined(SHADER_API_MOBILE) || defined(SHADER_API_GLCORE) +#if defined(SHADER_API_MOBILE) || (defined(SHADER_API_GLCORE) && !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) // Workaround for bug on Nintendo Switch where SHADER_API_GLCORE is mistakenly defined #define MAX_VISIBLE_LIGHTS 32 #else #define MAX_VISIBLE_LIGHTS 256 From 43381d9aae5fe378bab948b39f902e08e604145c Mon Sep 17 00:00:00 2001 From: Martin Thorzen <35328557+martint-unity@users.noreply.github.com> Date: Mon, 25 May 2020 12:36:26 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- com.unity.render-pipelines.universal/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 7669ad20e4b..6503e4e5a54 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -45,7 +45,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an issue that caused the inverse view and projection matrix to output wrong values on some platforms. [case 1243990](https://issuetracker.unity3d.com/issues/urp-8-dot-1-breaks-unity-matrix-i-vp). - Fixed GLES shaders compilation failing on Windows platform (not a mobile platform) due to uniform count limit. - Fixed an issue with not being able to remove Light Mode Tags [case 1240895](https://issuetracker.unity3d.com/issues/urp-unable-to-remove-added-lightmode-tags-of-filters-property-in-render-object). -- Fixed an issue with not being able to remove Light Mode Tags [case 1240895](https://issuetracker.unity3d.com/issues/urp-unable-to-remove-added-lightmode-tags-of-filters-property-in-render-object) - Fixed an issue where preset button could still be used, when it is not supposed to. [case 1246261](https://issuetracker.unity3d.com/issues/urp-reset-functionality-does-not-work-for-renderobject-preset-asset) ## [7.3.0] - 2020-03-11 From 254c5eaa8539c88fe4009650e1bb544f3987059c Mon Sep 17 00:00:00 2001 From: martint-unity Date: Mon, 25 May 2020 12:47:01 +0200 Subject: [PATCH 3/3] Fixed a merge issue --- com.unity.render-pipelines.universal/CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 6503e4e5a54..f20487173c9 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -37,14 +37,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed SceneView Draw Modes not being updated properly after opening new Scene view panels or changing the Editor layout. - Fixed an issue that caused viewport to work incorrectly when rendering to textures. [case 1225103](https://issuetracker.unity3d.com/issues/urp-the-viewport-rect-isnt-correctly-applied-when-the-camera-is-outputting-into-a-rendertexture). - Fixed an issue that caused incorrect sampling of HDR reflection probe textures. -- Fixed UI text of RenderObjects feature to display LightMode tag instead of Shader Pass Name. [case 1201696](https://issuetracker.unity3d.com/issues/render-feature-slash-pass-ui-has-a-field-for-shader-pass-name-when-it-actually-expects-shader-pass-lightmode) -- Fixed an issue that caused memory allocations when sorting cameras. [case 1226448](https://issuetracker.unity3d.com/issues/2d-renderer-using-more-than-one-camera-that-renders-out-to-a-render-texture-creates-gc-alloc-every-frame) - Fixed an issue that caused the inverse view and projection matrix to output wrong values in some platforms. [case 1243990](https://issuetracker.unity3d.com/issues/urp-8-dot-1-breaks-unity-matrix-i-vp) - Fixed UI text of RenderObjects feature to display LightMode tag instead of Shader Pass Name. [case 1201696](https://issuetracker.unity3d.com/issues/render-feature-slash-pass-ui-has-a-field-for-shader-pass-name-when-it-actually-expects-shader-pass-lightmode). - Fixed an issue that caused memory allocations when sorting cameras. [case 1226448](https://issuetracker.unity3d.com/issues/2d-renderer-using-more-than-one-camera-that-renders-out-to-a-render-texture-creates-gc-alloc-every-frame). -- Fixed an issue that caused the inverse view and projection matrix to output wrong values on some platforms. [case 1243990](https://issuetracker.unity3d.com/issues/urp-8-dot-1-breaks-unity-matrix-i-vp). - Fixed GLES shaders compilation failing on Windows platform (not a mobile platform) due to uniform count limit. -- Fixed an issue with not being able to remove Light Mode Tags [case 1240895](https://issuetracker.unity3d.com/issues/urp-unable-to-remove-added-lightmode-tags-of-filters-property-in-render-object). - Fixed an issue where preset button could still be used, when it is not supposed to. [case 1246261](https://issuetracker.unity3d.com/issues/urp-reset-functionality-does-not-work-for-renderobject-preset-asset) ## [7.3.0] - 2020-03-11