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

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)

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.

Unity 6000.2.0a4 was released with a line in the changelog:

XR: Fixed foveated rendering with D3D12 render passes. (UUM-85398)

So I tried on a new fresh project and still can’t see foveated rendering working and still seeing log spam with messages: Use of GfxDeviceD3D12::DispatchComputeProgram is forbidden during a render pass!

Update: after experimenting with settings more I was able to see foveation and get rid of DispatchComputeProgram warning but foveated area does not react to eye look direction - it always stays in the middle. Tried both over Steam Link with Steam OpenXR runtime and over Air Link with Meta OpenXR runtime.
To get rid of DispatchComputeProgram warning I had to disable shadows and Post-Processing completely in the Main Camera Rendering settings (two checkboxes). This is obviously not a proper fix but at least something.

So there are still multiple issues with Foveated Rendering, in it’s current state it’s completely unusable (at least in DX12):

It only works if all post processing and shadows are completely deactivated (as @Shii reported), else it will just spam warnings in the console. This also happens if no foveation is set, just activating the feature is enough to produce endless and rapid spamming in console.

Besides this I was not able to measure any positive impact on GPU load, even if I use heavy render features (with post processing and shadows turned off). I did see the visual degradation on the edges of the screen, though, so foveation was active.
Also there seems to be misalignment in the foveation radius between left and right eye.

I did a new bug report, as all previous bug reports (at least the ones with public link) are falsely set to resolved:
IN-104942

This feature is either in a very bad state, or no one is understanding how to set it up correctly.

Hi, do you have a link for that issue?
This is still happening in 6.3, so I wonder if this will be fixed at all, since PCVR is not a priority…

This is the public link: Unity Issue Tracker - [DX12][XR] Foveated rendering does not work if Shadows and Post Processing are enabled on DX12

Not much activity so far….

Any updates on this issue? This feature is completely broken on DX12…