Custom single pass stereo matrices in HDRP. How?

I’ve shared my hack here if anyone else runs into this. It involves making changes to both HDRP and SRP Core =(

The official solution is to write your own XR Provider plugin (EDIT: not anymore!)— which seems like an excessive amount of effort just to set a couple of matrices. Whoever designed Unity’s XR system clearly didn’t consider the possibility of someone wanting to render stereo without targeting a specific XR hardware device. In my opinion, this perfectly reflects how most parts of Unity have been built since the shift toward SRPs: without customization in mind. After so many years watching Unity continue down this path, I’ve lost all hope that the mindset will change. And so, I search daily for alternative engines—so far without finding a good match.

EDIT 1: Apparently, according to Andy from Unity, the correct approach is to write a OpenXR provider, NOT a XR Provider Plugin based on the XR SDK.

EDIT 2: Turns out my MockHMD based hack is useless. MockHMD seems to be driving the frame rate. So Application.targetFrameRate is ignored making the frame rate completely unpredictable =(

EDIT 3: Found a fix: don’t let MockHMD initialize XR, do it yourself instead.