Skip to content

Commit 9e45051

Browse files
alex-vazquez-unity3dEvergreen
authored andcommitted
Render Graph - Fixing auto upgrade of moved namespace
Fixing missing moved from to make the API be auto updated. https://jira.unity3d.com/browse/UUM-61578
1 parent 615cbd2 commit 9e45051

12 files changed

+54
-64
lines changed

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/IRenderGraphBuilder.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System;
2-
using System.Collections.Generic;
3-
using UnityEngine.Rendering;
2+
using UnityEngine.Scripting.APIUpdating;
43

54
namespace UnityEngine.Rendering.RenderGraphModule
65
{
76
/// <summary>
87
/// Common base interface for the different render graph builders. These functions are supported on all builders.
98
/// </summary>
9+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
1010
public interface IBaseRenderGraphBuilder : IDisposable
1111
{
1212
/// <summary>
@@ -132,6 +132,7 @@ public interface IBaseRenderGraphBuilder : IDisposable
132132
/// A builder for a compute render pass
133133
/// <see cref="RenderGraph.AddComputePass"/>
134134
/// </summary>
135+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
135136
public interface IComputeRenderGraphBuilder : IBaseRenderGraphBuilder
136137
{
137138

@@ -149,6 +150,7 @@ public void SetRenderFunc<PassData>(BaseRenderFunc<PassData, ComputeGraphContext
149150
/// A builder for an unsafe render pass.
150151
/// <see cref="RenderGraph.AddUnsafePass"/>
151152
/// </summary>
153+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
152154
public interface IUnsafeRenderGraphBuilder : IBaseRenderGraphBuilder
153155
{
154156
/// <summary>
@@ -165,6 +167,7 @@ public void SetRenderFunc<PassData>(BaseRenderFunc<PassData, UnsafeGraphContext>
165167
/// A builder for a raster render pass
166168
/// <see cref="RenderGraph.AddRasterRenderPass"/>
167169
/// </summary>
170+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
168171
public interface IRasterRenderGraphBuilder : IBaseRenderGraphBuilder
169172
{
170173
/// <summary>

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/IRenderGraphRecorder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
using UnityEngine.Scripting.APIUpdating;
2+
13
namespace UnityEngine.Rendering.RenderGraphModule
24
{
35
/// <summary>
46
/// A base class that can be inherited by render graph implementers. Currently this is only used by URP. In the future this will allow shared SRP rendering features between HDRP and URP through render graph.
57
/// </summary>
8+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
69
public interface IRenderGraphRecorder
710
{
811
/// <summary>

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.Compiler.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
using System;
2-
using UnityEngine.Rendering;
1+
using UnityEngine.Rendering.RenderGraphModule.NativeRenderPassCompiler;
32

43
namespace UnityEngine.Rendering.RenderGraphModule
54
{
65
public partial class RenderGraph
76
{
87
//TODO(ddebaets) move old compile func/members over
98

10-
NativeRenderPassCompiler.NativePassCompiler nativeCompiler = null;
9+
NativePassCompiler nativeCompiler = null;
1110

12-
internal NativeRenderPassCompiler.NativePassCompiler CompileNativeRenderGraph(int graphHash)
11+
internal NativePassCompiler CompileNativeRenderGraph(int graphHash)
1312
{
1413
using (new ProfilingScope(m_RenderGraphContext.cmd, ProfilingSampler.Get(RenderGraphProfileId.CompileRenderGraph)))
1514
{
1615
if (nativeCompiler == null)
17-
nativeCompiler = new NativeRenderPassCompiler.NativePassCompiler(m_CompilationCache);
16+
nativeCompiler = new NativePassCompiler(m_CompilationCache);
1817

1918
bool compilationIsCached = nativeCompiler.Initialize(m_Resources, m_RenderPasses, m_DebugParameters.disablePassCulling, name, m_EnableCompilationCaching, graphHash, m_ExecutionCount);
2019
if (!compilationIsCached)

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Diagnostics;
44
using System.Runtime.CompilerServices;
55
using UnityEngine.Experimental.Rendering;
6+
using UnityEngine.Scripting.APIUpdating;
67
// Typedef for the in-engine RendererList API (to avoid conflicts with the experimental version)
78
using CoreRendererListDesc = UnityEngine.Rendering.RendererUtils.RendererListDesc;
89

@@ -11,7 +12,7 @@ namespace UnityEngine.Rendering.RenderGraphModule
1112
/// <summary>
1213
/// Sets the read and write access for the depth buffer.
1314
/// </summary>
14-
[Flags]
15+
[Flags][MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
1516
public enum DepthAccess
1617
{
1718
///<summary>Read Access.</summary>
@@ -25,7 +26,7 @@ public enum DepthAccess
2526
/// <summary>
2627
/// Express the operations the rendergraph pass will do on a resource.
2728
/// </summary>
28-
[Flags]
29+
[Flags][MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
2930
public enum AccessFlags
3031
{
3132
///<summary>The pass does not access the resource at all. Calling Use* functions with none has no effect.</summary>
@@ -51,6 +52,7 @@ public enum AccessFlags
5152
/// An object representing the internal context of a rendergraph pass execution.
5253
/// This object is public for technical reasons only and should not be used.
5354
/// </summary>
55+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
5456
public class InternalRenderGraphContext
5557
{
5658
internal ScriptableRenderContext renderContext;
@@ -83,6 +85,7 @@ internal interface IDerivedRendergraphContext
8385
/// command buffer that can be used to schedule all commands. This will eventually be deprecated
8486
/// in favor of more specific contexts that have more specific command buffer types.
8587
/// </summary>
88+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
8689
public struct RenderGraphContext : IDerivedRendergraphContext
8790
{
8891
private InternalRenderGraphContext wrappedContext;
@@ -107,6 +110,7 @@ public void FromInternalContext(InternalRenderGraphContext context)
107110
/// This class declares the context object passed to the execute function of a raster render pass.
108111
/// <see cref="RenderGraph.AddRasterRenderPass"/>
109112
/// </summary>
113+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
110114
public struct RasterGraphContext : IDerivedRendergraphContext
111115
{
112116
private InternalRenderGraphContext wrappedContext;
@@ -135,6 +139,7 @@ public void FromInternalContext(InternalRenderGraphContext context)
135139
/// This class declares the context object passed to the execute function of a compute render pass.
136140
/// <see cref="RenderGraph.AddComputePass"/>
137141
/// </summary>
142+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
138143
public class ComputeGraphContext : IDerivedRendergraphContext
139144
{
140145
private InternalRenderGraphContext wrappedContext;
@@ -164,6 +169,7 @@ public void FromInternalContext(InternalRenderGraphContext context)
164169
/// This class declares the context object passed to the execute function of an unsafe render pass.
165170
/// <see cref="RenderGraph.AddUnsafePass"/>
166171
/// </summary>
172+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
167173
public class UnsafeGraphContext : IDerivedRendergraphContext
168174
{
169175
private InternalRenderGraphContext wrappedContext;
@@ -191,6 +197,7 @@ public void FromInternalContext(InternalRenderGraphContext context)
191197
/// <summary>
192198
/// This struct contains properties which control the execution of the Render Graph.
193199
/// </summary>
200+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
194201
public struct RenderGraphParameters
195202
{
196203
///<summary>Identifier for this render graph execution.</summary>
@@ -216,12 +223,14 @@ public struct RenderGraphParameters
216223
/// <typeparam name="ContextType">The type of the context that will be passed to the render function.</typeparam>
217224
/// <param name="data">Render Pass specific data.</param>
218225
/// <param name="renderGraphContext">Global Render Graph context.</param>
226+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
219227
public delegate void BaseRenderFunc<PassData, ContextType>(PassData data, ContextType renderGraphContext) where PassData : class, new();
220228

221229

222230
/// <summary>
223231
/// This class is the main entry point of the Render Graph system.
224232
/// </summary>
233+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
225234
public partial class RenderGraph
226235
{
227236
///<summary>Maximum number of MRTs supported by Render Graph.</summary>
@@ -2148,7 +2157,7 @@ void PreRenderPassSetRenderTargets(in CompiledPassInfo passInfo, RenderGraphPass
21482157
else
21492158
{
21502159
throw new InvalidOperationException("Setting MRTs without a depth buffer is not supported.");
2151-
}
2160+
}
21522161
}
21532162
else
21542163
{
@@ -2547,15 +2556,17 @@ internal TextureHandle GetGlobal(int globalPropertyId)
25472556
}
25482557
}
25492558

2550-
#if DEVELOPMENT_BUILD || UNITY_EDITOR
25512559
/// <summary>
25522560
/// Render Graph Scoped Profiling markers
25532561
/// </summary>
2562+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
25542563
public struct RenderGraphProfilingScope : IDisposable
25552564
{
2565+
#if DEVELOPMENT_BUILD || UNITY_EDITOR
25562566
ProfilingSampler m_Sampler;
25572567
RenderGraph m_RenderGraph;
25582568
bool m_Disposed;
2569+
#endif
25592570

25602571
/// <summary>
25612572
/// Profiling Scope constructor
@@ -2564,10 +2575,12 @@ public struct RenderGraphProfilingScope : IDisposable
25642575
/// <param name="sampler">Profiling Sampler to be used for this scope.</param>
25652576
public RenderGraphProfilingScope(RenderGraph renderGraph, ProfilingSampler sampler)
25662577
{
2578+
#if DEVELOPMENT_BUILD || UNITY_EDITOR
25672579
m_RenderGraph = renderGraph;
25682580
m_Sampler = sampler;
25692581
m_Disposed = false;
25702582
renderGraph.BeginProfilingSampler(sampler);
2583+
#endif
25712584
}
25722585

25732586
/// <summary>
@@ -2581,6 +2594,7 @@ public void Dispose()
25812594
// Protected implementation of Dispose pattern.
25822595
void Dispose(bool disposing)
25832596
{
2597+
#if DEVELOPMENT_BUILD || UNITY_EDITOR
25842598
if (m_Disposed)
25852599
return;
25862600

@@ -2593,34 +2607,7 @@ void Dispose(bool disposing)
25932607
}
25942608

25952609
m_Disposed = true;
2610+
#endif
25962611
}
25972612
}
2598-
#else
2599-
/// <summary>
2600-
/// Render Graph Scoped Profiling markers
2601-
/// </summary>
2602-
public struct RenderGraphProfilingScope : IDisposable
2603-
{
2604-
/// <summary>
2605-
/// Profiling Scope constructor
2606-
/// </summary>
2607-
/// <param name="renderGraph">Render Graph used for this scope.</param>
2608-
/// <param name="sampler">Profiling Sampler to be used for this scope.</param>
2609-
public RenderGraphProfilingScope(RenderGraph renderGraph, ProfilingSampler sampler)
2610-
{
2611-
}
2612-
2613-
/// <summary>
2614-
/// Dispose pattern implementation
2615-
/// </summary>
2616-
public void Dispose()
2617-
{
2618-
}
2619-
2620-
// Protected implementation of Dispose pattern.
2621-
void Dispose(bool disposing)
2622-
{
2623-
}
2624-
}
2625-
#endif
26262613
}

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System;
22
using System.Diagnostics;
3-
using System.Collections.Generic;
4-
using UnityEngine.Rendering;
3+
using UnityEngine.Scripting.APIUpdating;
54

65
namespace UnityEngine.Rendering.RenderGraphModule
76
{
87
/// <summary>
98
/// Use this struct to set up a new Render Pass.
109
/// </summary>
10+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
1111
public struct RenderGraphBuilder : IDisposable
1212
{
1313
RenderGraphPass m_RenderPass;

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphBuilders.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using System;
22
using System.Diagnostics;
3-
using System.Collections.Generic;
43
using UnityEngine.Experimental.Rendering;
5-
using UnityEngine.Rendering;
6-
using static UnityEngine.Rendering.DebugUI;
7-
using ValueTuple = System.ValueTuple;
84

95
namespace UnityEngine.Rendering.RenderGraphModule
106
{
@@ -232,7 +228,7 @@ private ResourceHandle UseResource(in ResourceHandle handle, AccessFlags flags)
232228
ValidateWriteTo(handle);
233229
m_RenderPass.AddResourceWrite(m_Resources.GetNewVersionedHandle(handle));
234230
m_Resources.IncrementWriteCount(handle);
235-
}
231+
}
236232

237233
return GetLatestVersionHandle(handle);
238234
}

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphDefaultResources.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using UnityEngine.Rendering;
1+
using UnityEngine.Scripting.APIUpdating;
22

33
namespace UnityEngine.Rendering.RenderGraphModule
44
{
55
/// <summary>
66
/// Helper class allowing access to default resources (black or white texture, etc.) during render passes.
77
/// </summary>
8+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
89
public class RenderGraphDefaultResources
910
{
1011
// We need to keep around a RTHandle version of default regular 2D textures since RenderGraph API is all RTHandle.

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceAccelerationStructure.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
using System;
21
using System.Diagnostics;
3-
4-
using UnityEngine.Rendering;
2+
using UnityEngine.Scripting.APIUpdating;
53

64
namespace UnityEngine.Rendering.RenderGraphModule
75
{
86
/// <summary>
97
/// RayTracingAccelerationStructure resource handle.
108
/// </summary>
119
[DebuggerDisplay("RayTracingAccelerationStructure ({handle.index})")]
10+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
1211
public struct RayTracingAccelerationStructureHandle
1312
{
1413
private static RayTracingAccelerationStructureHandle s_NullHandle = new RayTracingAccelerationStructureHandle();
@@ -41,6 +40,7 @@ public struct RayTracingAccelerationStructureHandle
4140
/// <summary>
4241
/// Descriptor used to identify ray tracing acceleration structure resources
4342
/// </summary>
43+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
4444
public struct RayTracingAccelerationStructureDesc
4545
{
4646
/// <summary>RayTracingAccelerationStructure name.</summary>

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceBuffer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System;
21
using System.Diagnostics;
2+
using UnityEngine.Scripting.APIUpdating;
33

44
namespace UnityEngine.Rendering.RenderGraphModule
55
{
66
/// <summary>
77
/// Graphics Buffer resource handle.
88
/// </summary>
99
[DebuggerDisplay("Buffer ({handle.index})")]
10+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
1011
public struct BufferHandle
1112
{
1213
// Minor Warning: This calls the zeroing constructor this means that the embedded ResourceHandle struct will also be zero-ed

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System;
2-
using System.Diagnostics;
32
using System.Collections.Generic;
3+
using System.Diagnostics;
44
using System.Runtime.CompilerServices;
55
using UnityEngine.Experimental.Rendering;
6-
using UnityEngine.Rendering;
7-
using UnityEngine.Rendering.RendererUtils;
8-
6+
using UnityEngine.Scripting.APIUpdating;
97
// Typedefs for the in-engine RendererList API (to avoid conflicts with the experimental version)
108
using CoreRendererList = UnityEngine.Rendering.RendererList;
119
using CoreRendererListDesc = UnityEngine.Rendering.RendererUtils.RendererListDesc;
@@ -15,11 +13,12 @@ namespace UnityEngine.Rendering.RenderGraphModule
1513
/// <summary>
1614
/// Basic properties of a RTHandle needed by the render graph compiler. It is not always possible to derive these
1715
/// given an RTHandle to the user needs to pass these in.
18-
///
16+
///
1917
/// We don't use a full RenderTargetDescriptor here as filling out a full descriptor may not be trivial and not all
2018
/// members of the descriptor are actually used by the render graph. This struct is the minimum set of info needed by the render graph.
2119
/// If you want to develop some utility framework to work with render textures, etc. it's probably better to use RenderTargetDescriptor.
2220
/// </summary>
21+
[MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule")]
2322
public struct RenderTargetInfo
2423
{
2524
/// <summary>
@@ -516,7 +515,7 @@ internal TextureHandle ImportTexture(in RTHandle rt, in ImportResourceParams imp
516515
// (The alternative is for the code calling ImportTexture to use the overload that takes a RenderTargetInfo).
517516
if(rt != null)
518517
ValidateRenderTarget(texHandle.handle);
519-
518+
520519
return texHandle;
521520
}
522521

@@ -675,7 +674,7 @@ internal TextureHandle ImportBackbuffer(RenderTargetIdentifier rt, in RenderTarg
675674
private void ValidateRenderTarget(in ResourceHandle res)
676675
{
677676
if(RenderGraph.enableValidityChecks)
678-
{
677+
{
679678
RenderTargetInfo outInfo;
680679
GetRenderTargetInfo(res, out outInfo);
681680
}

0 commit comments

Comments
 (0)