Enabling SRP Foveated Rendering crashes Editor

Trying to make eye tracked foveated rendering to work for PCVR project. Made a new project, did everything according to documentation page:
Made fresh Unity 6 6000.0.23f1 URP project, changed Graphics API to DirectX12, installed XR Plug-In Management, enabled OpenXR, in OpenXR settings set Foveated Rendering API to SRP Foveation, enabled Foveated Rendering in OpenXR Feature Groups.
Tested with Quest Pro via AirLink and SteamLink. Tried both Meta XR Runtime and SteamXR runtime. Sending eye and face tracking data enabled in Quest headset. It also enabled in Meta Quest Link desktop app and in SteamLink.
As soon as I launch empty scene it appears in headset but in Unity log spammed every frame with messages:

Use of GfxDeviceD3D12::DispatchComputeProgram is forbidden during a render pass!

Next, I tried using example code to activate foveated rendering:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;

public class FoveationStarter : MonoBehaviour
{
  List<XRDisplaySubsystem> xrDisplays = new List<XRDisplaySubsystem>();

  void Start()
  {
    SubsystemManager.GetSubsystems(xrDisplays);
    if (xrDisplays.Count == 1)
    {
      xrDisplays[0].foveatedRenderingLevel = 1.0f; // Full strength
      xrDisplays[0].foveatedRenderingFlags 
          = XRDisplaySubsystem.FoveatedRenderingFlags.GazeAllowed;
    }
  }
}

As soon as it executed Unity Editor crashes instantly.
Crash only happens if I have something on scene, a simple Unity Cube for example.
Tried updating OpenXR Plugin from 1.12.1 to 1.13.0 but it did not help.

Also tried using Vulkan insted of DirectX12.
In this case there is no log spam in editor log and activating foveated rendering with script does not crash an editor but foveation pattern looks completely wrong and does not react to eye tracking: left part of right screen very pixelated, middle part is less pixelated and right part not pixelated. Same for left screen but in reverse.
vulkan_foveation
Red - high pixelation, yellow - mid pixelation, green - no pixelation.

System specs:
Windows 11 23H2 22631.4317
i7-12700K
32Gb RAM
GeForce RTX 2080 Driver 561.09

Hello! Thank you so much for the info, let me know if you’ve already submitted a bug report and have an issue tracker link. It would be great to have a full scene to look at the issue!

Yes, I submitted bug report too. Sent it few days ago on Unity 6000.0.22f1. Updating to release version of Unity 6000.0.23f1 did not fix the issue.
Issue tracker link: IN-86717

Hey, just looping back here to confirm we were able to repro the issue, the bug has entered triage to get looked at by a dev team so you should get updates via the issue tracker. Thank you so much for taking the time to submit everything!

Looks like public issue tracker link is here: Unity Issue Tracker - [Quest] Editor crashes on toggleFoveation when activating SRP Foveated Rendering in DX12

1 Like

Hi,

I have the same issues with SRP Foveated Rendering with a Varjo VR-3 via OpenXR. The only good thing is that the editor doesn’t crash :slight_smile:

When using DX12, editor spams this log every frame and it doesn’t look like Foveated Rendering is working:

Use of GfxDeviceD3D12::DispatchComputeProgram is forbidden during a render pass!

When using Vulkan, the rendering is highly pixelated in the center, exactly as decribed by the drawing in the original post. It doesn’t react to eye tracking too.

While the crash issue is fixed, the other issues raised by original poster aren’t :frowning:

What is the state of SRP foveation in Unity 6 OpenXR? Should it work with Varjo headset out of the box?

System information:
Varjo VR-3
RTX 3080 (Drivers 566.36)
Windows 10 22H2
Varjo Base 4.6.1.11
Unity 6000.0.36f1
OpenXR 1.14.0

Yes, they fixed the crash but not other issues. Seems like that SRP Foveation only actually works on Android builds and not on PCVR. I kinda gave up on this for now.

Hi!

The issue of Foveated rendering not working with D3D12 has been submitted to the developers, you can follow it’s progress here: Unity Issue Tracker - [D3D12][XR] SRP Foveation foveated rendering on Windows platform not working when Graphics API is set to D3D12 (the link will become available roughly in an hour of me posting this comment)

2 Likes

Issue has been closed as duplicate.

Resolution says:
fixed in Unity 6000.2.0a4
Duplicate of another internal issue: UUM-85398: Foveated Rendering and D3D12 render passes not working

I guess now we can only wait for 6000.2 release or hope that fix will be backported to 6000.0 or 6000.1 at some point.