@@ -592,7 +592,7 @@ internal void ForceCleanup()
592592 nativeCompiler ? . Cleanup ( ) ;
593593
594594 m_CompilationCache ? . Clear ( ) ;
595-
595+
596596 DelegateHashCodeUtils . ClearCache ( ) ;
597597 }
598598
@@ -1165,6 +1165,17 @@ void CheckNotUsedWhenRecordingPass()
11651165 throw new InvalidOperationException ( RenderGraphExceptionMessages . GetExceptionMessage ( RenderGraphState . RecordingPass ) ) ;
11661166 }
11671167
1168+ [ Conditional ( "DEVELOPMENT_BUILD" ) , Conditional ( "UNITY_EDITOR" ) ]
1169+ void CheckNotUsingNativeRenderPassCompiler ( )
1170+ {
1171+ if ( enableValidityChecks && nativeRenderPassesEnabled )
1172+ {
1173+ throw new InvalidOperationException (
1174+ "`AddRenderPass` is not compatible with the Native Render Pass Compiler. It is meant to be used with the HDRP Compiler. " +
1175+ "The APIs that are compatible with the Native Render Pass Compiler are AddUnsafePass, AddComputePass and AddRasterRenderPass." ) ;
1176+ }
1177+ }
1178+
11681179 [ Conditional ( "DEVELOPMENT_BUILD" ) , Conditional ( "UNITY_EDITOR" ) ]
11691180 void CheckNotUsedWhenActive ( )
11701181 {
@@ -1368,11 +1379,12 @@ public RenderGraphBuilder AddRenderPass<PassData>(string passName, out PassData
13681379 [ CallerLineNumber ] int line = 0 ) where PassData : class , new ( )
13691380#endif
13701381 {
1382+ CheckNotUsingNativeRenderPassCompiler ( ) ;
13711383 CheckNotUsedWhenRecordingPass ( ) ;
13721384
13731385 m_RenderGraphState = RenderGraphState . RecordingPass ;
13741386
1375- var renderPass = m_RenderGraphPool . Get < RenderGraphPass < PassData > > ( ) ;
1387+ var renderPass = m_RenderGraphPool . Get < RenderGraphPass < PassData > > ( ) ;
13761388 renderPass . Initialize ( m_RenderPasses . Count , m_RenderGraphPool . Get < PassData > ( ) , passName , RenderGraphPassType . Legacy , sampler ) ;
13771389 renderPass . AllowGlobalState ( true ) ; // Old pass types allow global state by default as HDRP relies on it
13781390
0 commit comments