Exception: Pass 'XXX' is using the legacy rendergraph API. You cannot use legacy passes with the native render pass compiler. Please do not use AddPass on the rendergrpah but use one of the more specific pas types such as AddRasterPass.
// Create transient textures for hit points and lightingTextureHandlehitPointTexture=renderGraph.CreateTexture(newTextureDesc(_rtWidth,_rtHeight,false,false){colorFormat=GraphicsFormat.R16G16_UNorm,clearBuffer=!useAsyncCompute,clearColor=Color.clear,enableRandomWrite=_tracingInCS,name="SSR_HitPoint_Texture"});// @IllusionRP: // Notice if we use RenderGraph.CreateTexture, ssr lighting texture may be re-used before lighting.// So we should always use SsrAccum(RTHandle) instead of SsrLighting in RenderGraph.// TextureHandle ssrLightingTexture = renderGraph.CreateTexture(new TextureDesc(_rtWidth, _rtHeight, false, false)// {// colorFormat = GraphicsFormat.R16G16B16A16_SFloat,// clearBuffer = !useAsyncCompute && !_needAccumulate,// clearColor = Color.clear,// enableRandomWrite = _reprojectInCS || _needAccumulate,// name = "SSR_Lighting_Texture"// });// Clear operations for async compute or PBR accumulationvarssrAccumRT=_rendererData.GetCurrentFrameRT((int)IllusionFrameHistoryType.ScreenSpaceReflectionAccumulation);TextureHandlessrAccum=renderGraph.ImportTexture(ssrAccumRT);ClearTexturePass(renderGraph,ssrAccum,Color.clear,useAsyncCompute);// @IllusionRP: Always use SSrAccumTextureHandlessrLightingTexture=ssrAccum;
privatevoidDoNativeRenderPass(ScriptableRenderContextcontext,refRenderingDatarenderingData){varcamDesc=renderingData.cameraData.cameraTargetDescriptor;varcolorHandle=renderingData.cameraData.renderer.cameraColorTargetHandle;vardepthHandle=renderingData.cameraData.renderer.cameraDepthTargetHandle;intwidth=camDesc.width,height=camDesc.height,samples=Mathf.Max(1,camDesc.msaaSamples);vardepthDesc=newAttachmentDescriptor(SystemInfo.GetGraphicsFormat(DefaultFormat.DepthStencil));depthDesc.ConfigureTarget(depthHandle.nameID,true,true);varaccumDesc=newAttachmentDescriptor(RenderTextureFormat.ARGBFloat);accumDesc.ConfigureClear(Color.clear,0);accumDesc.loadStoreTarget=BuiltinRenderTextureType.None;varrevealDesc=newAttachmentDescriptor(RenderTextureFormat.RFloat);revealDesc.ConfigureClear(Color.white,0);revealDesc.loadStoreTarget=BuiltinRenderTextureType.None;varcolorDesc=newAttachmentDescriptor(colorHandle.rt.descriptor.graphicsFormat);colorDesc.ConfigureTarget(colorHandle.nameID,true,true);constintkDepth=0;constintkAccum=1;constintkReveal=2;constintkColor=3;varattachments=newNativeArray<AttachmentDescriptor>(4,Allocator.Temp);attachments[kDepth]=depthDesc;// 0 -> Depth Attachmentattachments[kAccum]=accumDesc;// 1 -> Accumulateattachments[kReveal]=revealDesc;// 2 -> Revealageattachments[kColor]=colorDesc;// 3 -> Color Attachmentusing(context.BeginScopedRenderPass(width,height,samples,attachments,depthAttachmentIndex:kDepth)){attachments.Dispose();varcompositeBuffer=newNativeArray<int>(2,Allocator.Temp);compositeBuffer[0]=kAccum;compositeBuffer[1]=kReveal;using(context.BeginScopedSubPass(compositeBuffer,isDepthStencilReadOnly:false)){compositeBuffer.Dispose();CommandBuffercmd=CommandBufferPool.Get();using(newProfilingScope(cmd,_accumulateSampler)){context.ExecuteCommandBuffer(cmd);cmd.Clear();vardrawSettings=CreateDrawingSettings(OitTagId,refrenderingData,renderingData.cameraData.defaultOpaqueSortFlags);#if UNITY_2023_1_OR_NEWERvarrendererList=default(RendererList);RenderingUtils.CreateRendererListWithRenderStateBlock(context,renderingData,drawSettings,_filteringSettings,_renderStateBlock,refrendererList);cmd.DrawRendererList(rendererList);#elsecontext.DrawRenderers(renderingData.cullResults,refdrawSettings,ref_filteringSettings,ref_renderStateBlock);#endif}context.ExecuteCommandBuffer(cmd);cmd.Clear();CommandBufferPool.Release(cmd);// Need to execute it immediately to avoid sync issues between context and cmd buffercontext.ExecuteCommandBuffer(renderingData.commandBuffer);renderingData.commandBuffer.Clear();}varcompositeTarget=newNativeArray<int>(1,Allocator.Temp);compositeTarget[0]=kColor;varcompositeInput=newNativeArray<int>(2,Allocator.Temp);compositeInput[0]=kAccum;compositeInput[1]=kReveal;using(context.BeginScopedSubPass(compositeTarget,compositeInput,isDepthStencilReadOnly:true)){compositeTarget.Dispose();compositeInput.Dispose();CommandBuffercmd=CommandBufferPool.Get();using(newProfilingScope(cmd,_compositeSampler)){Vector2viewportScale=colorHandle.useScaling?newVector2(colorHandle.rtHandleProperties.rtHandleScale.x,colorHandle.rtHandleProperties.rtHandleScale.y):Vector2.one;_compositeMat.Value.EnableKeyword(IllusionShaderKeywords._ILLUSION_RENDER_PASS_ENABLED);Blitter.BlitTexture(cmd,viewportScale,_compositeMat.Value,0);}context.ExecuteCommandBuffer(cmd);cmd.Clear();CommandBufferPool.Release(cmd);// Need to execute it immediately to avoid sync issues between context and cmd buffercontext.ExecuteCommandBuffer(renderingData.commandBuffer);renderingData.commandBuffer.Clear();}}}