Getting NullReferenceException When Building to Android and Using Immediate Mode Drawing
Whenever I load a scene where I am doing Immediate Mode Drawing after building to Android, using
using (Draw.Command(cam))
I get the following runtime error (I have Compatibility Mode disabled.):
2024/12/11 21:31:22.985 24901 25004 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2024/12/11 21:31:22.985 24901 25004 Error Unity at UnityEngine.Rendering.RenderGraphModule.RenderGraphResourceRegistry.GetRenderTargetInfo (UnityEngine.Rendering.RenderGraphModule.ResourceHandle& res, UnityEngine.Rendering.RenderGraphModule.RenderTargetInfo& outInfo) [0x00000] in <00000000000000000000000000000000>:0 2024/12/11 21:31:22.985 24901 25004 Error Unity at UnityEngine.Rendering.RenderGraphModule.RenderGraphBuilders.CheckUseFragment (UnityEngine.Rendering.RenderGraphModule.TextureHandle tex, System.Boolean isDepth) [0x00000] in <00000000000000000000000000000000>:0 2024/12/11 21:31:22.985 24901 25004 Error Unity at UnityEngine.Rendering.RenderGraphModule.RenderGraphBuilders.SetRenderAttachment (UnityEngine.Rendering.RenderGraphModule.TextureHandle tex, System.Int32 index, UnityEngine.Rendering.RenderGraphModule.AccessFlags flags, System.Int32 mipLevel, System.Int32 depthSlice) [0x00000] in <00000000000000000000000000000000>:0 2024/12/11 21:31:22.985 24901 25004 Error Unity at Shapes.ShapesRenderPass.RecordRenderGraph (UnityEngine.Rendering.RenderGraphModule.RenderGraph renderGraph, UnityEngine.Renderi
If I disable the script that is using immediate mode drawing, the errors disappear.
Could you try applying the hotfix from this thread to see if it works? this is almost certainly the cause, and should work with the next update!
https://shapes.userecho.com/communities/1/topics/678-rendergraph-depthopaque-texture-disabled-error