Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Frame timing render thread issue ECS + VR (openXR) on PC

Discussion in 'Graphics for ECS' started by Arnold_2013, Jul 3, 2023.

  1. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    Sorry I don't know what the exact issue is, and maybe ECS has nothing to do with it. But I am running out of ideas. (I tried the unity VR forum, in case its a VR related issue. But got no response. https://forum.unity.com/threads/steamvr-always-late-start-even-at-80hz-with-enough-cpu.1455055/)

    I am on Unity 2022.3.0. using URP. with DX11 on windows 10.

    When I have RenderDoc loaded in the Editor, the frametiming on the render thread performs better (this is how I interpret it). Why?

    Any insight about the images below is appreciated. Some speciflic things I don't understand:
    1. I don't know why these renderthread events are moved in the frame by renderDoc, or why it works better with it loaded in the editor.
    2. I don't know where this "CustomRenderTexture.Update" comes from, I've tried toggling settings on the camera, BuildSettings and Universal Render pipeline Asset.
    3. I don't know if the above points are even the cause of this issue.

    Without loading RenderDoc in the editor, the frame is not pushed to SteamVR on time. And steamVR shows a "late start".


    With RenderDoc loaded in editor. Some events are moved on the RenderThread and the "PopulateNextFrameDesc" now takes up the expected time. Resulting in correct frame timing for SteamVR.



    In VR a stable framerate is very important, so there is a special Vsync that keeps the FPS at a stable value. In the profiler this shows up as the "FrameEvent.XRBeginFrame" so this is not a bottleneck. https://docs.unity3d.com/Manual/xrsdk-display.html
     
  2. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    Switching to Dx12 or Vulkan 'solved' this issue.

    Dx12 crashes windows at random intervals on my 5700xt, I am just going to assume this is a driver issue. So I will try to see if Vulkan is stable enough to develop with.
    Since my issue is mainly a quality of life one I could still use Dx11, and just accept the 1 frame of extra latency.