Skip to content

Commit d18aadb

Browse files
Unity 6 Render Graph API Compilation Fixes (#224)
1 parent f53df7c commit d18aadb

File tree

10 files changed

+31
-5
lines changed

10 files changed

+31
-5
lines changed

com.microsoft.mrtk.graphicstools.shadergraph.unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.microsoft.mrtk.graphicstools.shadergraph.unity",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"displayName": "MRTK Graphics Tools Shader Graph",
55
"description": "Graphics tools and components for developing Mixed Reality applications in Unity Shader Graph.",
66
"documentationUrl": "https://aka.ms/mrtk3graphics",

com.microsoft.mrtk.graphicstools.unity/Editor/Utilities/ScreenshotUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static bool CaptureScreenshot(string path, int superSize = 1, bool transp
8686

8787
if (camera == null)
8888
{
89-
#if UNITY_2023_1_OR_NEWER
89+
#if UNITY_6000_0_OR_NEWER
9090
camera = GameObject.FindFirstObjectByType<Camera>();
9191
#else
9292
camera = GameObject.FindObjectOfType<Camera>();

com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicBlurRenderPass.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public AcrylicBlurRenderPass(string _profilerLabel, int _downSamplePasses, int _
5656

5757
private Vector4 info = Vector4.zero;
5858

59+
#if UNITY_6000_0_OR_NEWER
60+
[System.Obsolete]
61+
#endif
5962
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
6063
{
6164
int width = cameraTextureDescriptor.width / downSample;
@@ -110,6 +113,9 @@ private static RenderTargetIdentifier GetIdentifier(RenderTargetHandle target)
110113

111114
#endif
112115

116+
#if UNITY_6000_0_OR_NEWER
117+
[System.Obsolete]
118+
#endif
113119
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
114120
{
115121
CommandBuffer cmd = CommandBufferPool.Get(profilerLabel);

com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Acrylic/Scripts/AcrylicLayer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#if GT_USE_URP
55
using System;
66
using UnityEngine;
7+
#if !UNITY_6000_0_OR_NEWER
78
using UnityEngine.Experimental.Rendering.Universal;
9+
#endif
810
using UnityEngine.Profiling;
911
using UnityEngine.Rendering;
1012
using UnityEngine.Rendering.Universal;

com.microsoft.mrtk.graphicstools.unity/Runtime/Experimental/Magnifier/Scripts/MagnifierManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#if GT_USE_URP
55
using System.Collections.Generic;
66
using UnityEngine;
7+
#if !UNITY_6000_0_OR_NEWER
78
using UnityEngine.Experimental.Rendering.Universal;
9+
#endif
810
using UnityEngine.Rendering.Universal;
911

1012
namespace Microsoft.MixedReality.GraphicsTools

com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/ClearRenderTargetPass.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public ClearRenderTargetPass(ClearRenderTarget.PassSettings passSettings)
2323
/// <summary>
2424
/// Queues a ClearRenderTarget command based on the pass settings.
2525
/// </summary>
26+
#if UNITY_6000_0_OR_NEWER
27+
[System.Obsolete]
28+
#endif
2629
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
2730
{
2831
CommandBuffer cmd = CommandBufferPool.Get();

com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/DrawFullscreenPass.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public DrawFullscreenPass(string tag)
3535
}
3636

3737
/// <inheritdoc/>
38+
#if UNITY_6000_0_OR_NEWER
39+
[System.Obsolete]
40+
#endif
3841
public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
3942
{
4043
RenderTextureDescriptor blitTargetDescriptor = renderingData.cameraData.cameraTargetDescriptor;
@@ -70,6 +73,9 @@ public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderin
7073
}
7174

7275
/// <inheritdoc/>
76+
#if UNITY_6000_0_OR_NEWER
77+
[System.Obsolete]
78+
#endif
7379
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
7480
{
7581
CommandBuffer cmd = CommandBufferPool.Get(profilerTag);

com.microsoft.mrtk.graphicstools.unity/Runtime/Utilities/FlyCameraController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void OnEnable()
9595
/// </summary>
9696
private void Start()
9797
{
98-
#if UNITY_2023_1_OR_NEWER
98+
#if UNITY_6000_0_OR_NEWER
9999
SubsystemManager.GetSubsystems(xrDisplaySubsystems);
100100
#else
101101
SubsystemManager.GetInstances(xrDisplaySubsystems);

com.microsoft.mrtk.graphicstools.unity/Samples~/MaterialGallery/Scripts/MaterialMatrix.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ private void Update()
5252
// Poll for when the render pipeline changes.
5353
if (useDefaultMaterial)
5454
{
55+
#if UNITY_6000_0_OR_NEWER
56+
if (lastRenderPipelineAsset != GraphicsSettings.defaultRenderPipeline)
57+
#else
5558
if (lastRenderPipelineAsset != GraphicsSettings.renderPipelineAsset)
59+
#endif
5660
{
5761
BuildMatrix();
5862
}
@@ -83,8 +87,11 @@ private void BuildMatrix()
8387

8488
if (useDefaultMaterial)
8589
{
90+
#if UNITY_6000_0_OR_NEWER
91+
lastRenderPipelineAsset = GraphicsSettings.defaultRenderPipeline;
92+
#else
8693
lastRenderPipelineAsset = GraphicsSettings.renderPipelineAsset;
87-
94+
#endif
8895
if (lastRenderPipelineAsset != null)
8996
{
9097
currentMaterial = lastRenderPipelineAsset.defaultMaterial;

com.microsoft.mrtk.graphicstools.unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.microsoft.mrtk.graphicstools.unity",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"displayName": "MRTK Graphics Tools",
55
"description": "Graphics tools and components for developing Mixed Reality applications in Unity.",
66
"documentationUrl": "https://aka.ms/mrtk3graphics",

0 commit comments

Comments
 (0)