We are using 2019.2 and SRP packages updated to 6.9.1.
In our situation, the scenes render fine in the editor scene and game windows when first loaded. After exiting play mode we get the following 2 errors and nothing displays in either scene or game windows:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.LightLoopUpdateCullingParameters (UnityEngine.Rendering.ScriptableCullingParameters& cullingParams) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/Lighting/LightLoop/LightLoop.cs:1717)
UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.TryCalculateFrameParameters (UnityEngine.Camera camera, UnityEngine.Experimental.Rendering.HDPipeline.XRPass xrPass, UnityEngine.Experimental.Rendering.HDPipeline.HDAdditionalCameraData& additionalCameraData, UnityEngine.Experimental.Rendering.HDPipeline.HDCamera& hdCamera, UnityEngine.Rendering.ScriptableCullingParameters& cullingParams) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/RenderPipeline/HDRenderPipeline.cs:2259)
UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Camera[ ] cameras) (at Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview/Runtime/RenderPipeline/HDRenderPipeline.cs:1043)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[ ] cameras) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipeline.cs:72)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, UnityEngine.Camera[ ] cameras, System.IntPtr loopPtr, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at C:/buildslave/unity/build/Runtime/Export/RenderPipeline/RenderPipelineManager.cs:67)
XRSystem.ReleaseFrame() was not called!
UnityEngine.Rendering.RenderPipelineManager:smile:oRenderLoop_Internal(RenderPipelineAsset, Camera[ ], IntPtr, AtomicSafetyHandle)
Strangely, when entering play mode a second time the rendering works again, but exiting play mode causes the same errors and nothing is rendered. Reloading the scene doesn’t fix it. The only fix we have found is restarting Unity.
I have loaded up the HDRP demo project and it works normally. I have tried different scenes in our project, but they all behave the same. I have also tried re-creating a new HDRPasset and reimporting all packages. This seems to point at the issue being some setting in our project, but I haven’t been able to track it down. Any help would be greatly appreciated.