Build a workaround for the DLSS bug (which clearly shows that this is a nasty and probably easy to fix Unity bug and not some incompatibility of current DLSS version with VR as QA is stating):
using System.Collections;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.XR;
public class DLSSHack : MonoBehaviour
{
HDAdditionalCameraData hDCamera;
bool hackApplied = false;
void Start()
{
hDCamera = GetComponent<HDAdditionalCameraData>();
}
// Update is called once per frame
void Update()
{
if (XRSettings.stereoRenderingMode == XRSettings.StereoRenderingMode.SinglePassInstanced && hackApplied == false)
{
hackApplied = true;
Debug.Log("Applying bad hack for nasty Unity bug.");
StartCoroutine(HackCoRoutine());
}
}
IEnumerator HackCoRoutine()
{
hDCamera.allowDeepLearningSuperSampling = false;
yield return new WaitForEndOfFrame();
hDCamera.allowDeepLearningSuperSampling = true;
}
}
Can probably be done in a nicer way with OpenXR events, but I still have hope that this thing will get fixed…