RenderGraph Depth/Opaque Texture disabled Error
I am trying to update my project to use RenderGraph support for newer features being used by OpenXR. I have been using Shapes with RenderGraph disabled (Compatibility Mode) because Shapes was always throwing errors at me when using Immediate Mode drawing.
I took the time to make a new project using RenderGraph and implemented your sample IM drawing script, and too my surprise I didn't get the same errors I had in my project. After investigating I found the reason was the URPAsset between the 2 projects.
If both Depth Texture & Opaque Texture are disabled in the URPAsset and RenderGraph is enabled, Shapes will throw the following errors and then crash Unity:
NullReferenceException: Object reference not set to an instance of an object
Render Graph Execution error
InvalidOperationException: The CullingResults instance is no longer valid. This can happen if you re-use it across multiple frames.
I'll post the full log in the next comment.
My game targets the Meta Quest 3, and I need to have the Depth Texture & Opaque Texture disabled for performance reasons, and Shapes is heavily integrated into the game, I hope you can help me Freya!
[Exception] InvalidOperationException: The CullingResults instance is no longer valid. This can happen if you re-use it across multiple frames.
CullingResults.Validate() at <575c8d5d94a9444f82eba927ac72f8df>:0
RendererListParams.Validate() at <575c8d5d94a9444f82eba927ac72f8df>:0
ScriptableRenderContext.CreateRendererList() at <575c8d5d94a9444f82eba927ac72f8df>:0
RenderGraphResourceRegistry.CreateRendererLists() at ./Library/PackageCache/com.unity.render-pipelines.core@2be5e7224a10/Runtime/RenderGraph/RenderGraphResourceRegistry.cs:1204
1202: ref var rendererListResource = ref m_RendererListResources[rendererList];
1203: ref var desc = ref rendererListResource.desc;
-->1204: rendererListResource.rendererList = context.CreateRendererList(ref desc);
1205: m_ActiveRendererLists.Add(rendererListResource.rendererList);
1206: break;
RenderGraph.CompileNativeRenderGraph() at ./Library/PackageCache/com.unity.render-pipelines.core@2be5e7224a10/Runtime/RenderGraph/RenderGraph.Compiler.cs:32
30: }
--> 32: m_Resources.CreateRendererLists(m_RendererLists, m_RenderGraphContext.renderContext, m_RendererListCulling);
34: return nativeCompiler;
RenderGraph.Execute() at ./Library/PackageCache/com.unity.render-pipelines.core@2be5e7224a10/Runtime/RenderGraph/RenderGraph.cs:1225
1224: if (nativeRenderPassesEnabled)
-->1225: CompileNativeRenderGraph(graphHash);
1226: else
1227: CompileRenderGraph(graphHash);
GUIUtility.ProcessEvent()