Skip to content

Commit 848eebd

Browse files
authored
Merge pull request #182 from CyberAgentGameEntertainment/bugfix/unity_6004_error
Fix Unity 6 compile errors: remove testframework.graphics and guard removed CompatibilityMode API
2 parents 790fc60 + 2160188 commit 848eebd

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

Assets/Nova/Runtime/Core/Scripts/ApplyDistortionPass.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public partial class ApplyDistortionPass : ScriptableRenderPass
1818
private readonly Material _material;
1919
private readonly ProfilingSampler _renderPassProfilingSampler;
2020

21+
#if !UNITY_6000_4_OR_NEWER
2122
private RenderTargetIdentifier _distortedUvBufferIdentifier;
23+
#endif
2224

2325
public ApplyDistortionPass(bool applyToSceneView, Shader shader)
2426
{
@@ -28,11 +30,14 @@ public ApplyDistortionPass(bool applyToSceneView, Shader shader)
2830
renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
2931
}
3032

33+
#if !UNITY_6000_4_OR_NEWER
3134
public void Setup(RenderTargetIdentifier distortedUvBufferIdentifier)
3235
{
3336
_distortedUvBufferIdentifier = distortedUvBufferIdentifier;
3437
}
38+
#endif
3539

40+
#if !UNITY_6000_4_OR_NEWER
3641
#if UNITY_2023_3_OR_NEWER
3742
[Obsolete(DeprecationMessage.CompatibilityScriptingAPIObsolete, false)]
3843
#endif
@@ -56,5 +61,6 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
5661
context.ExecuteCommandBuffer(cmd);
5762
CommandBufferPool.Release(cmd);
5863
}
64+
#endif
5965
}
6066
}

Assets/Nova/Runtime/Core/Scripts/DistortedUvBufferPass.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public partial class DistortedUvBufferPass : ScriptableRenderPass
2121
private readonly ShaderTagId _shaderTagId;
2222
private FilteringSettings _filteringSettings;
2323

24+
#if !UNITY_6000_4_OR_NEWER
2425
private RTHandle _renderTargetRTHandle;
26+
#endif
2527

2628
#if UNITY_2023_3_OR_NEWER
2729
private readonly GraphicsFormat _colorFormat;
@@ -40,11 +42,14 @@ public DistortedUvBufferPass(string lightMode)
4042
#endif
4143
}
4244

45+
#if !UNITY_6000_4_OR_NEWER
4346
public void Setup(RTHandle renderTargetRTHandle)
4447
{
4548
_renderTargetRTHandle = renderTargetRTHandle;
4649
}
50+
#endif
4751

52+
#if !UNITY_6000_4_OR_NEWER
4853
#if UNITY_2023_3_OR_NEWER
4954
[Obsolete(DeprecationMessage.CompatibilityScriptingAPIObsolete, false)]
5055
#endif
@@ -83,5 +88,6 @@ public override void Execute(ScriptableRenderContext context, ref RenderingData
8388
context.ExecuteCommandBuffer(cmd);
8489
CommandBufferPool.Release(cmd);
8590
}
91+
#endif
8692
}
8793
}

Assets/Nova/Runtime/Core/Scripts/ScreenSpaceDistortion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD
5151
|| renderingData.cameraData.cameraType == CameraType.Preview
5252
|| !IsPostProcessingAllowed(ref renderingData))
5353
return;
54-
54+
#if !UNITY_6000_4_OR_NEWER
5555
#if UNITY_2023_3_OR_NEWER
5656
if (GraphicsSettings.GetRenderPipelineSettings<RenderGraphSettings>().enableRenderCompatibilityMode)
5757
#endif
@@ -65,6 +65,7 @@ public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingD
6565
_distortedUvBufferPass.Setup(_distortedUvBufferRTHandle);
6666
_applyDistortionPass.Setup(_distortedUvBufferRTHandle);
6767
}
68+
#endif
6869

6970
renderer.EnqueuePass(_distortedUvBufferPass);
7071
renderer.EnqueuePass(_applyDistortionPass);

Assets/Nova/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jp.co.cyberagent.nova",
33
"displayName": "NOVA Shader",
4-
"version": "3.5.0",
4+
"version": "3.5.1",
55
"unity": "2022.3",
66
"license": "MIT",
77
"dependencies": {

0 commit comments

Comments
 (0)