Skip to content

Commit a3f4669

Browse files
theo-at-unityEvergreen
authored andcommitted
[6.0][SRP] Convert HDRP & URP projects to GTF9
1 parent d42d317 commit a3f4669

412 files changed

Lines changed: 20539 additions & 12277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/Editor/LightBakingBackendSwitcher.cs

Lines changed: 0 additions & 57 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/Editor/LightBakingBackendSwitcher.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/Setup/Assembly-CSharp-Editor.asmdef

Lines changed: 0 additions & 15 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/Setup/SetupGraphicsTestCases.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/Setup/SetupGraphicsTestCases.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/TestFilterGenerator.cs

Lines changed: 0 additions & 107 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/Scripts/TestFilterGenerator.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/Editor/SetupProject.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
using System;
2-
using System.Collections;
32
using System.Collections.Generic;
4-
using UnityEngine;
5-
using UnityEngine.Experimental.Rendering;
63
using UnityEngine.Rendering;
74
using UnityEditor;
8-
using UnityEditor.Rendering;
95

106
public static class SetupProject
117
{
@@ -41,7 +37,6 @@ public static void ApplySettings()
4137
if (Options.TryGetValue(arg, out action))
4238
action();
4339
}
44-
UnityEditor.TestTools.Graphics.SetupProject.ApplySettings();
4540
}
4641

4742
[MenuItem("Graphic Tests/Project Setup/RP: Deferred")]

Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
using System;
22
using System.Collections;
3-
using System.Collections.Generic;
4-
using NUnit;
53
using NUnit.Framework;
64
using UnityEngine;
75
using UnityEngine.Rendering;
8-
using UnityEngine.TestTools;
96
using UnityEngine.TestTools.Graphics;
107
using UnityEngine.Rendering.HighDefinition;
118
using UnityEngine.SceneManagement;
12-
using UnityEngine.Events;
13-
using System.IO;
149
using System.Linq;
1510
using UnityEngine.VFX;
1611

17-
public class HDRP_GraphicTestRunner
12+
public static class HDRP_GraphicTestRunner
1813
{
19-
private bool GPUResidentDrawerRequested()
14+
private static bool GPUResidentDrawerRequested()
2015
{
2116
bool forcedOn = false;
2217
foreach (var arg in Environment.GetCommandLineArgs())
@@ -35,11 +30,7 @@ private bool GPUResidentDrawerRequested()
3530
return false;
3631
}
3732

38-
[UnityTest]
39-
[PrebuildSetup("SetupGraphicsTestCases")]
40-
[UseGraphicsTestCases]
41-
[Timeout(450 * 1000)] // Set timeout to 450 sec. to handle complex scenes with many shaders (previous timeout was 300s)
42-
public IEnumerator Run(GraphicsTestCase testCase)
33+
public static IEnumerator Run(SceneGraphicsTestCase testCase)
4334
{
4435
HDRP_TestSettings settings = null;
4536
Camera[] cameras = null;
@@ -54,7 +45,7 @@ public IEnumerator Run(GraphicsTestCase testCase)
5445
UnityEditor.ShaderUtil.allowAsyncCompilation = true;
5546
UnityEditor.EditorSettings.asyncShaderCompilation = true;
5647

57-
Debug.Log($"Running test case '{testCase}' with scene '{testCase.ScenePath}' {testCase.ReferenceImagePathLog}.");
48+
Debug.Log($"Running test case '{testCase}' with scene '{testCase.ScenePath}' {testCase.ReferenceImage.LoadMessage}.");
5849
SceneManager.LoadScene(testCase.ScenePath);
5950

6051
// Wait for scene loading to retrieve settings/camera.
@@ -225,7 +216,7 @@ public IEnumerator Run(GraphicsTestCase testCase)
225216
if (settingsSG == null || !settingsSG.compareSGtoBI)
226217
{
227218
// Standard Test
228-
ImageAssert.AreEqual(testCase.ReferenceImage, camera, settings?.ImageComparisonSettings, testCase.ReferenceImagePathLog);
219+
ImageAssert.AreEqual(testCase.ReferenceImage.Image, camera, settings?.ImageComparisonSettings, testCase.ReferenceImage.LoadMessage);
229220

230221
// For some reason, tests on mac os have started failing with render graph enabled by default.
231222
// Some tests have 400+ gcalloc in them. Unfortunately it's not reproductible outside of command line so it's impossible to debug.
@@ -256,7 +247,7 @@ public IEnumerator Run(GraphicsTestCase testCase)
256247
// First test: Shader Graph
257248
try
258249
{
259-
ImageAssert.AreEqual(testCase.ReferenceImage, camera, (settings != null) ? settings.ImageComparisonSettings : null, testCase.ReferenceImagePathLog);
250+
ImageAssert.AreEqual(testCase.ReferenceImage.Image, camera, (settings != null) ? settings.ImageComparisonSettings : null, testCase.ReferenceImage.LoadMessage);
260251
}
261252
catch (AssertionException)
262253
{
@@ -272,8 +263,7 @@ public IEnumerator Run(GraphicsTestCase testCase)
272263
// Second test: HDRP/Lit Materials
273264
try
274265
{
275-
ImageAssert.AreEqual(testCase.ReferenceImage, camera, (settings != null) ? settings.ImageComparisonSettings : null, testCase.ReferenceImagePathLog);
276-
}
266+
ImageAssert.AreEqual(testCase.ReferenceImage.Image, camera, (settings != null) ? settings.ImageComparisonSettings : null, testCase.ReferenceImage.LoadMessage); }
277267
catch (AssertionException)
278268
{
279269
biFail = true;
@@ -310,27 +300,11 @@ public IEnumerator Run(GraphicsTestCase testCase)
310300

311301
}
312302

313-
public void SetRayTracingAccumulationOnCameras(HDCamera[] hdCameras, bool b)
303+
public static void SetRayTracingAccumulationOnCameras(HDCamera[] hdCameras, bool b)
314304
{
315305
foreach(HDCamera hdCamera in hdCameras)
316306
{
317307
hdCamera.SetRayTracingAccumulation(b);
318308
}
319309
}
320-
321-
#if UNITY_EDITOR
322-
323-
[TearDown]
324-
public void DumpImagesInEditor()
325-
{
326-
UnityEditor.TestTools.Graphics.ResultsUtility.ExtractImagesFromTestProperties(TestContext.CurrentContext.Test);
327-
}
328-
329-
[TearDown]
330-
public void TearDownXR()
331-
{
332-
XRGraphicsAutomatedTests.running = false;
333-
}
334-
335-
#endif
336310
}

Tests/SRPTests/Packages/com.unity.testing.hdrp/TestRunner/HDRP_TestRunner.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"Unity.Postprocessing.Runtime",
66
"Unity.RenderPipelines.Core.Runtime",
77
"Unity.Testing.XR.Runtime",
8+
"UnityEditor.TestTools.Graphics",
89
"UnityEngine.TestTools.Graphics",
910
"Unity.RenderPipelines.GPUDriven.Runtime"
1011
],
@@ -18,4 +19,4 @@
1819
"precompiledReferences": [],
1920
"autoReferenced": true,
2021
"defineConstraints": []
21-
}
22+
}

0 commit comments

Comments
 (0)