HDRP + VR not working in 2019.1.0f2?

Hi,

I’ve been working on a Non-VR + VR game for the past year. It worked great in 2018.3, using the Post-Processing Volume. I decided to update to 2019.1 to make use of the HDRP features, but whenever I try to run the game in VR, I get this error:

IndexOutOfRangeException: Index was outside the bounds of the array.
UnityEngine.Experimental.Rendering.HDPipeline.LightLoop.BuildGPULightListsCommon (UnityEngine.Experimental.Rendering.HDPipeline.HDCamera hdCamera, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RenderTargetIdentifier cameraDepthBufferRT, UnityEngine.Rendering.RenderTargetIdentifier stencilTextureRT, System.Boolean skyEnabled) (at Library/PackageCache/com.unity.render-pipelines.high-definition@5.13.0-preview/Runtime/Lighting/LightLoop/LightLoop.cs:2361)

Which is referencing this code in LightLoop.cs:

for (int eyeIndex = 0; eyeIndex < 2; eyeIndex++)
{
    **m_LightListProjMatrices[eyeIndex] = CameraProjectionStereoLHS(hdCamera.camera, (Camera.StereoscopicEye)eyeIndex);**
    m_LightListProjscrMatrices[eyeIndex] = temp * m_LightListProjMatrices[eyeIndex];
    m_LightListInvProjscrMatrices[eyeIndex] = m_LightListProjscrMatrices[eyeIndex].inverse;
}

(** = the exact line where the error is thrown)

After this, I tried creating a new project and added OpenVR, HDRP and some Post-Processing effects just to test it out, and the same error was being thrown. I removed all the Post-Processing effects and the error still persisted.

Mind you, my Vive is still being tracked as I can see the camera moving around in the Editor Window when I move the Vive, but the Game window is completely black, and the error is thrown at almost (or all?) frames.

Is VR just not compatible with HDRP right now? Can I even go back to using Post-Processing Volumes in 2019.1? (I tried adding one but it was not doing anything, but that might just be because I still had HDRP on). If it’s not compatible right now I guess I can just go back to that until things change. Both Non-VR and VR versions of the game run on the same build, so making another build without HDRP is not the solution I am looking for.

Anyone found a fix for this yet if there is one?

Thank you in advance!

I had the same problem with the demo project. I’ve just upgraded it to 2019.2.a013 and updated the HDRP from the package manager. The process itself produced unpleasant bugs, but after a restart, all seems to be working. The black screen and LightLoop messages are gone.

According to the notes for the Scriptable Rendering Pipeline on Github, you can only use Single-Pass Stereo rendering for Unity 2019.1 and 2019.2 with HDRP. Is this perhaps why you are having an issue?