From d4bd72b0ee45d64a853c02f96a54dbe0ae112445 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Ledoux Date: Thu, 28 Mar 2024 11:17:19 +0000 Subject: [PATCH 1/6] Fix for viewport distortion when using dynamic resolution Fix for a distorted viewport when using no intermediate texture in XR rendering. When activating dynamic resolution and using a scale of < 1, the image becomes distorted. This fixes this issue. --- .../Runtime/UniversalRenderer.cs | 1 + .../Runtime/XR/XRSystem.cs | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 50125bd07e3..cca21643a52 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -620,6 +620,7 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re if (intermediateRenderTexture) CreateCameraRenderTarget(context, ref cameraTargetDescriptor, useDepthPriming); m_RenderOpaqueForwardPass.m_IsActiveTargetBackBuffer = !intermediateRenderTexture; + m_RenderTransparentForwardPass.m_IsActiveTargetBackBuffer = !intermediateRenderTexture; #if ENABLE_VR && ENABLE_XR_MODULE m_XROcclusionMeshPass.m_IsActiveTargetBackBuffer = !intermediateRenderTexture; #endif diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs b/Packages/com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs index 2d75a9f3463..462863fd3ca 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/XR/XRSystem.cs @@ -250,11 +250,6 @@ internal void UpdateCameraData(ref CameraData baseCameraData, in XRPass xr) baseCameraData.pixelHeight = (int)System.Math.Round(camPixelRect.height + camPixelRect.y) - (int)System.Math.Round(camPixelRect.y); baseCameraData.aspectRatio = (float)baseCameraData.pixelWidth / (float)baseCameraData.pixelHeight; - bool isDefaultXRViewport = (!(Math.Abs(xrViewport.x) > 0.0f || Math.Abs(xrViewport.y) > 0.0f || - Math.Abs(xrViewport.width) < xr.renderTargetDesc.width || - Math.Abs(xrViewport.height) < xr.renderTargetDesc.height)); - baseCameraData.isDefaultViewport = baseCameraData.isDefaultViewport && isDefaultXRViewport; - // Update cameraData cameraTargetDescriptor for XR. This descriptor is mainly used for configuring intermediate screen space textures var originalTargetDesc = baseCameraData.cameraTargetDescriptor; baseCameraData.cameraTargetDescriptor = xr.renderTargetDesc; From 21106c5ace656cfc1b5eaac67d5aa92e698d73e5 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 4 Apr 2024 10:07:01 +0000 Subject: [PATCH 2/6] [Port] [2021.3] [URP] [2D] ShaderGraph Pass name is not generated when the pass is "LightMode" = "Universal2D" Fix missing pass name https://jira.unity3d.com/browse/UUM-36358 --- .../Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs index bfe1abc200a..6228b1797fd 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Targets/UniversalLitSubTarget.cs @@ -560,6 +560,7 @@ public static PassDescriptor _2D(UniversalTarget target) var result = new PassDescriptor() { // Definition + displayName = "Universal 2D", referenceName = "SHADERPASS_2D", lightMode = "Universal2D", From 0f254f13693e89584867373304b7090ddae4ae83 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 4 Apr 2024 17:02:56 +0000 Subject: [PATCH 3/6] [Port] [2021.3] Use half instead of float on mobile for octahedral normal packing functions. Fixes https://jira.unity3d.com/browse/UUM-62216, in which artifacts appear (looks like uninitialized memory) when using the accurate G-buffer normals feature when targeting mobile. This feature uses a pair for function for performing octrahedral encoding and decoding of normals. The function misbehaves when targeting mobile, but not desktop. The main difference between mobile and desktop in shadercode is that desktop treats `half` as float, whereas on mobile `half` actually works. The functions for octahedral encoding take `float`'s as input, and are given `half`'s in the mobile path. In the function, we use `abs()` on the input and then negate it. This combination seems to cause a miscompilation of some sort, presumably because `abs` and negation are both input modifiers rather than real instructions - I'm not entirely sure, but it's some mix of those 3 things - half to float conversion, abs and negation. The most minimal fix that worked was this: ``` float3 UnpackNormalOctQuadEncode(float2 f) { - float3 n = float3(f.x, f.y, 1.0 - abs(f.x) - abs(f.y)); + float3 n = float3(f.x, f.y, 1.0 - abs(real(f.x)) - abs(real(f.y))); ``` But I instead decided to change the functions to use `real` instead of `float` throughout, as it it seemed cleaner. `real` is just an alias for `half` on mobile and `float` on desktop. --- .../ShaderLibrary/Packing.hlsl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl index b094f431a6f..e68a6582bfb 100644 --- a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl +++ b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl @@ -54,7 +54,7 @@ real3 UnpackNormalOctRectEncode(real2 f) // Ref: http://jcgt.org/published/0003/02/01/paper.pdf "A Survey of Efficient Representations for Independent Unit Vectors" // Encode with Oct, this function work with any size of output // return float between [-1, 1] -float2 PackNormalOctQuadEncode(float3 n) +real2 PackNormalOctQuadEncode(float3 n) { //float l1norm = dot(abs(n), 1.0); //float2 res0 = n.xy * (1.0 / l1norm); @@ -64,20 +64,20 @@ float2 PackNormalOctQuadEncode(float3 n) // Optimized version of above code: n *= rcp(max(dot(abs(n), 1.0), 1e-6)); - float t = saturate(-n.z); - return n.xy + float2(n.x >= 0.0 ? t : -t, n.y >= 0.0 ? t : -t); + real t = saturate(-n.z); + return n.xy + real2(n.x >= 0.0 ? t : -t, n.y >= 0.0 ? t : -t); } -float3 UnpackNormalOctQuadEncode(float2 f) +real3 UnpackNormalOctQuadEncode(real2 f) { - float3 n = float3(f.x, f.y, 1.0 - abs(f.x) - abs(f.y)); + real3 n = real3(f.x, f.y, 1.0 - abs(f.x) - abs(f.y)); //float2 val = 1.0 - abs(n.yx); //n.xy = (n.zz < float2(0.0, 0.0) ? (n.xy >= 0.0 ? val : -val) : n.xy); // Optimized version of above code: - float t = max(-n.z, 0.0); - n.xy += float2(n.x >= 0.0 ? -t : t, n.y >= 0.0 ? -t : t); + real t = max(-n.z, 0.0); + n.xy += real2(n.x >= 0.0 ? -t : t, n.y >= 0.0 ? -t : t); return normalize(n); } From 57eebe4743c9f7e42af9bea3ed39c4eeca2ced59 Mon Sep 17 00:00:00 2001 From: Juho Oravainen Date: Sat, 6 Apr 2024 03:42:40 +0000 Subject: [PATCH 4/6] 2021.3/shadersystem/uum 46187 usepass Backport. Make sure that shaders are reloaded after all shader import cases. This ensures that UsePass will always have up to date state and is not pointing to old data, which can cause rendering issues and even crashes. --- .../ShaderGraph/Assets/CommonAssets/Editor/FileMoveTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/FileMoveTests.cs b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/FileMoveTests.cs index 679fd1badab..bad320832e3 100644 --- a/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/FileMoveTests.cs +++ b/Tests/SRPTests/Projects/ShaderGraph/Assets/CommonAssets/Editor/FileMoveTests.cs @@ -195,6 +195,12 @@ public IEnumerator MoveDirectoryTests() yield return null; CloseGraphWindow(); + + // Wait for any potential compilation to finish before entering cleanup, which deletes the files + while (ShaderUtil.anythingCompiling) + { + yield return null; + } } } } From ef6b886b6de308e9bed680da2422f0dd7583c8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Penavaire?= Date: Sat, 6 Apr 2024 03:42:42 +0000 Subject: [PATCH 5/6] [21.3] Bump graphics packages - Bumped SRP packages from 12.1.14 to 12.1.15. --- Packages/com.unity.render-pipelines.core/CHANGELOG.md | 9 +++++++++ Packages/com.unity.render-pipelines.core/package.json | 2 +- .../CHANGELOG.md | 8 ++++++++ .../package.json | 4 ++-- .../CHANGELOG.md | 8 ++++++++ .../package.json | 10 +++++----- .../com.unity.render-pipelines.universal/CHANGELOG.md | 9 +++++++++ .../ValidationExceptions.json | 4 ++-- .../com.unity.render-pipelines.universal/package.json | 6 +++--- Packages/com.unity.shadergraph/CHANGELOG.md | 8 ++++++++ Packages/com.unity.shadergraph/package.json | 4 ++-- Packages/com.unity.visualeffectgraph/CHANGELOG.md | 9 +++++++++ Packages/com.unity.visualeffectgraph/package.json | 6 +++--- .../package.json | 6 +++--- 14 files changed, 72 insertions(+), 21 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/CHANGELOG.md b/Packages/com.unity.render-pipelines.core/CHANGELOG.md index dfe2274ec11..d4dffcd3235 100644 --- a/Packages/com.unity.render-pipelines.core/CHANGELOG.md +++ b/Packages/com.unity.render-pipelines.core/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + 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/) @@ -9,6 +10,14 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +### Fixed +- Fixed issue where errors could be thrown by debug action registration if deleting all axes in Input Manager. +- Fixed DebugUI.Button not working in Rendering Debugger runtime UI. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.render-pipelines.core/package.json b/Packages/com.unity.render-pipelines.core/package.json index f9af8b49e6e..a5081849a9f 100644 --- a/Packages/com.unity.render-pipelines.core/package.json +++ b/Packages/com.unity.render-pipelines.core/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.render-pipelines.core", "description": "SRP Core makes it easier to create or customize a Scriptable Render Pipeline (SRP). SRP Core contains reusable code, including boilerplate code for working with platform-specific graphics APIs, utility functions for common rendering operations, and shader libraries. The code in SRP Core is use by the High Definition Render Pipeline (HDRP) and Universal Render Pipeline (URP). If you are creating a custom SRP from scratch or customizing a prebuilt SRP, using SRP Core will save you time.", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "displayName": "Core RP Library", "dependencies": { diff --git a/Packages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md b/Packages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md index 5786e4246d0..6cdf5eb029e 100644 --- a/Packages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md +++ b/Packages/com.unity.render-pipelines.high-definition-config/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + 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/) @@ -9,6 +10,13 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.render-pipelines.high-definition-config/package.json b/Packages/com.unity.render-pipelines.high-definition-config/package.json index ed23eb83d50..6e52504f626 100644 --- a/Packages/com.unity.render-pipelines.high-definition-config/package.json +++ b/Packages/com.unity.render-pipelines.high-definition-config/package.json @@ -1,10 +1,10 @@ { "name": "com.unity.render-pipelines.high-definition-config", "description": "Configuration files for the High Definition Render Pipeline.", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "displayName": "High Definition RP Config", "dependencies": { - "com.unity.render-pipelines.core": "12.1.14" + "com.unity.render-pipelines.core": "12.1.15" } } \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.high-definition/CHANGELOG.md b/Packages/com.unity.render-pipelines.high-definition/CHANGELOG.md index de880b449b5..711c4ed6eb2 100644 --- a/Packages/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/Packages/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + 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/) @@ -9,6 +10,13 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +### Fixed +- Fixed shader compilation issues related to ternary operater misuse. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.render-pipelines.high-definition/package.json b/Packages/com.unity.render-pipelines.high-definition/package.json index 96c6f8afa19..f805f20f2ca 100644 --- a/Packages/com.unity.render-pipelines.high-definition/package.json +++ b/Packages/com.unity.render-pipelines.high-definition/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.render-pipelines.high-definition", "description": "The High Definition Render Pipeline (HDRP) is a high-fidelity Scriptable Render Pipeline built by Unity to target modern (Compute Shader compatible) platforms. HDRP utilizes Physically-Based Lighting techniques, linear lighting, HDR lighting, and a configurable hybrid Tile/Cluster deferred/Forward lighting architecture and gives you the tools you need to create games, technical demos, animations, and more to a high graphical standard.", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "displayName": "High Definition RP", "dependencies": { @@ -11,10 +11,10 @@ "com.unity.modules.animation": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.terrain": "1.0.0", - "com.unity.render-pipelines.core": "12.1.14", - "com.unity.shadergraph": "12.1.14", - "com.unity.visualeffectgraph": "12.1.14", - "com.unity.render-pipelines.high-definition-config": "12.1.14" + "com.unity.render-pipelines.core": "12.1.15", + "com.unity.shadergraph": "12.1.15", + "com.unity.visualeffectgraph": "12.1.15", + "com.unity.render-pipelines.high-definition-config": "12.1.15" }, "keywords": [ "graphics", diff --git a/Packages/com.unity.render-pipelines.universal/CHANGELOG.md b/Packages/com.unity.render-pipelines.universal/CHANGELOG.md index eb7bb16deee..e4deba3e36c 100644 --- a/Packages/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/Packages/com.unity.render-pipelines.universal/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + 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/) @@ -9,6 +10,14 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +### Fixed +- Fixed bright pixels when using a camera with skybox and MSAA rendering opaque objects with alpha clipping together with a transparent object if additive blending. +- Fixed an issue where renderer features didn't pass validation if they inherit from another renderer feature. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.render-pipelines.universal/ValidationExceptions.json b/Packages/com.unity.render-pipelines.universal/ValidationExceptions.json index 2daadd34de8..8e16faacb3a 100644 --- a/Packages/com.unity.render-pipelines.universal/ValidationExceptions.json +++ b/Packages/com.unity.render-pipelines.universal/ValidationExceptions.json @@ -2,8 +2,8 @@ "Exceptions": [ { "ValidationTest": "Package Lifecycle Validation", - "ExceptionError": "Package com.unity.render-pipelines.universal@12.1.14 depends on package com.unity.burst@1.5.0 which is in an invalid track for release purposes. Release versions can only depend on Release versions.", - "PackageVersion": "12.1.14" + "ExceptionError": "Package com.unity.render-pipelines.universal@12.1.15 depends on package com.unity.burst@1.5.0 which is in an invalid track for release purposes. Release versions can only depend on Release versions.", + "PackageVersion": "12.1.15" } ] } \ No newline at end of file diff --git a/Packages/com.unity.render-pipelines.universal/package.json b/Packages/com.unity.render-pipelines.universal/package.json index 90f3583a6bd..7a01af06d43 100644 --- a/Packages/com.unity.render-pipelines.universal/package.json +++ b/Packages/com.unity.render-pipelines.universal/package.json @@ -1,14 +1,14 @@ { "name": "com.unity.render-pipelines.universal", "description": "The Universal Render Pipeline (URP) is a prebuilt Scriptable Render Pipeline, made by Unity. URP provides artist-friendly workflows that let you quickly and easily create optimized graphics across a range of platforms, from mobile to high-end consoles and PCs.", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "displayName": "Universal RP", "dependencies": { "com.unity.mathematics": "1.2.1", "com.unity.burst": "1.8.9", - "com.unity.render-pipelines.core": "12.1.14", - "com.unity.shadergraph": "12.1.14" + "com.unity.render-pipelines.core": "12.1.15", + "com.unity.shadergraph": "12.1.15" }, "keywords": [ "graphics", diff --git a/Packages/com.unity.shadergraph/CHANGELOG.md b/Packages/com.unity.shadergraph/CHANGELOG.md index 519e3dfe481..b330f3b1ccc 100644 --- a/Packages/com.unity.shadergraph/CHANGELOG.md +++ b/Packages/com.unity.shadergraph/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + All notable changes to this package are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) @@ -9,6 +10,13 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +Version Updated +The version number for this package has increased due to a version update of a related graphics package. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.shadergraph/package.json b/Packages/com.unity.shadergraph/package.json index 0f1d3a1386c..bc271083a0b 100644 --- a/Packages/com.unity.shadergraph/package.json +++ b/Packages/com.unity.shadergraph/package.json @@ -1,11 +1,11 @@ { "name": "com.unity.shadergraph", "description": "The Shader Graph package adds a visual Shader editing tool to Unity. You can use this tool to create Shaders in a visual way instead of writing code. Specific render pipelines can implement specific graph features. Currently, both the High Definition Rendering Pipeline and the Universal Rendering Pipeline support Shader Graph.", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "displayName": "Shader Graph", "dependencies": { - "com.unity.render-pipelines.core": "12.1.14", + "com.unity.render-pipelines.core": "12.1.15", "com.unity.searcher": "4.9.1" }, "samples": [ diff --git a/Packages/com.unity.visualeffectgraph/CHANGELOG.md b/Packages/com.unity.visualeffectgraph/CHANGELOG.md index d540c41aabe..e971e193654 100644 --- a/Packages/com.unity.visualeffectgraph/CHANGELOG.md +++ b/Packages/com.unity.visualeffectgraph/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + 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/) @@ -9,6 +10,14 @@ 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. +## [12.1.14] - 2024-04-03 + +This version is compatible with Unity 2021.3.38f1. + +### Fixed +- Fixed missing node links when copy/pasting a system with missing PointCacheAsset. +- Incompatibility with HLSL 2021. + ## [12.1.13] - 2023-12-21 This version is compatible with Unity 2021.3.35f1. diff --git a/Packages/com.unity.visualeffectgraph/package.json b/Packages/com.unity.visualeffectgraph/package.json index 9bf2631c7c2..55c7cf4f18d 100644 --- a/Packages/com.unity.visualeffectgraph/package.json +++ b/Packages/com.unity.visualeffectgraph/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.visualeffectgraph", "displayName": "Visual Effect Graph", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "description": "The Visual Effect Graph is a node based visual effect editor. It allows you to author next generation visual effects that Unity simulates directly on the GPU. The Visual Effect Graph is production-ready for the High Definition Render Pipeline and runs on all platforms supported by it. Full support for the Universal Render Pipeline and compatible mobile devices is still in development.", "keywords": [ @@ -12,8 +12,8 @@ "particles" ], "dependencies": { - "com.unity.shadergraph": "12.1.14", - "com.unity.render-pipelines.core": "12.1.14" + "com.unity.shadergraph": "12.1.15", + "com.unity.render-pipelines.core": "12.1.15" }, "samples": [ { diff --git a/Tests/SRPTests/Packages/com.unity.testing.graphics-performance/package.json b/Tests/SRPTests/Packages/com.unity.testing.graphics-performance/package.json index 1e31a313cb3..cc76a8c4c8b 100644 --- a/Tests/SRPTests/Packages/com.unity.testing.graphics-performance/package.json +++ b/Tests/SRPTests/Packages/com.unity.testing.graphics-performance/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.testing.graphics-performance", "displayName": "Performance Graphics Tests Framework", - "version": "12.1.14", + "version": "12.1.15", "unity": "2021.3", "unityRelease": "0a1", "description": "Provides performance framework helpers for writing tests for graphics code, such as test scene asset description, performance performance report and shader static analysis.", @@ -16,6 +16,6 @@ "dependencies": { "com.unity.test-framework.performance": "3.0.3", "com.unity.shaderanalysis": "1.0.0", - "com.unity.render-pipelines.core": "12.1.14" + "com.unity.render-pipelines.core": "12.1.15" } -} +} \ No newline at end of file From fd82bba8ab048e475e27df291351d52c1afcd881 Mon Sep 17 00:00:00 2001 From: Esmeralda Salamone Date: Tue, 9 Apr 2024 11:33:11 +0000 Subject: [PATCH 6/6] [2021][ShaderGraph] Precision backport fix Backport to fix some of our shaderlab code gen so that it made half precision explicit in all circumstances, this makes it compile correctly for mobile devices. --- .../Editor/Data/Graphs/DynamicVectorMaterialSlot.cs | 2 +- .../Editor/Data/Graphs/Vector1MaterialSlot.cs | 2 +- .../Tests/Editor/UnitTests/MaterialSlotTests.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs index ad0674e1ba7..5ca8f2d1141 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/DynamicVectorMaterialSlot.cs @@ -84,7 +84,7 @@ protected override string ConcreteSlotValueAsVariable() var channelCount = SlotValueHelper.GetChannelCount(concreteValueType); string values = NodeUtils.FloatToShaderValue(value.x); if (channelCount == 1) - return values; + return string.Format("$precision({0})", values); for (var i = 1; i < channelCount; i++) values += ", " + NodeUtils.FloatToShaderValue(value[i]); return string.Format("$precision{0}({1})", channelCount, values); diff --git a/Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs b/Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs index 69588881abf..d3be40d45b0 100644 --- a/Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs +++ b/Packages/com.unity.shadergraph/Editor/Data/Graphs/Vector1MaterialSlot.cs @@ -69,7 +69,7 @@ public override VisualElement InstantiateControl() protected override string ConcreteSlotValueAsVariable() { - return NodeUtils.FloatToShaderValue(value); + return string.Format("$precision({0})", NodeUtils.FloatToShaderValue(value)); } public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode) diff --git a/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialSlotTests.cs b/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialSlotTests.cs index 53395d6abcd..01b17296242 100644 --- a/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialSlotTests.cs +++ b/Packages/com.unity.shadergraph/Tests/Editor/UnitTests/MaterialSlotTests.cs @@ -103,8 +103,8 @@ public void MaterialSlotReturnsValidDefaultValue() Assert.AreEqual(expected, result); m_NodeA.slot1.value = 6; - result = m_NodeA.slot1.GetDefaultValue(GenerationMode.ForReals); - Assert.AreEqual("6", result); + result = m_NodeA.slot1.GetDefaultValue(GenerationMode.ForReals, ConcretePrecision.Half); + Assert.AreEqual("half(6)", result); m_NodeA.slot2.value = new Vector4(6, 6, 6, 1); result = m_NodeA.slot2.GetDefaultValue(GenerationMode.ForReals, ConcretePrecision.Half);