Because of stereo instancing issues with null source Blit, we can try using DrawProcedural.
Everything seems to work ok, except for some bizarre unity_StereoEyeIndex functionality inside of the fragment shader during instancing.
Usually, in the stereo instancing path, we source unity_StereoEyeIndex from the fragment input structure's stereoTargetEyeIndex member. In fact, stereoTargetEyeIndex is needed as it is bound to the SV_RenderTargetArrayIndex semantic, which dictates which render target array slice is rasterized to.
However, for whatever reason, reading stereoTargetEyeIndex is not reliable in the fragment shader. However, if I use the raw instance ID passed into the fragment shader, that works correctly. More work probably needs to be done, but this is fine for now.
Basically, something is going wrong with UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX or stereoTargetEyeIndex in stereo instancing. We can work around it by not calling it, because UNITY_SETUP_INSTANCE_ID sets up unity_StereoEyeIndex for us, if instancing is enabled.
Usually, in the stereo instancing path, we source unity_StereoEyeIndex from the fragment input structure's stereoTargetEyeIndex member. In fact, stereoTargetEyeIndex is needed as it is bound to the SV_RenderTargetArrayIndex semantic, which dictates which render target array slice is rasterized to.
However, for whatever reason, reading stereoTargetEyeIndex is not reliable in the fragment shader. However, if I use the raw instance ID passed into the fragment shader, that works correctly. More work probably needs to be done, but this is fine for now.
- Removed indexing from non cascade path
- Avoid homogeneous coordinate division when in orthographic projection
- Removed 7x7 tent filtering that was used in PC and cascades. That's too much as when doing cascades we resolve into screenscape shadow and do bilinear filter.