Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Huge performance lost switching from Built-in Render Pipeline (BiRP) to HDRP

Discussion in 'High Definition Render Pipeline' started by macrod, Feb 16, 2021.

  1. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    31
    Hi,

    I'm using 2019.4.1.17f1 and already turned off everything I don't need on HDRP Asset and Frame Settings.

    The scene is an interior one and really simple, with BiRP it takes ~2ms (~1ms for GPU). Well, it is CPU bound, but both CPU and GPU durations are very small, so neither is considered a problem.

    However, after switching to HDRP, it take 10+ times long. It is now more severely CPU bound.

    I don't really understand what the costly functions in the Profiler mean:
    - RenderPipelineManager.DoRenderLoop_Internal
    - Inl_HDRenderPipelineAllRenderRequest
    - Inl_HDRenderPipeline::Render New Game Object
    - SRPBRender.ApplyShader

    GPUView shows there are ~15 D3D11 submissions, between each 2 of them there is ~50% GPU idle (There is GPU works immediately after submissions, in later half GPU is idle). With D3D12, there is only 1 frame's work every 4 VSync's, many many small works on Copy queue, even more and smaller rendering submissions each with some KMD work.

    I know someone says HDRP has some base cost, but how can the GPU idles so often? Even if HDRP is considered scaling well, it should be able to handle small scene with just a few lights.

    Thanks.
     
    Last edited: Feb 17, 2021
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    But it doesn't scale well. It also does have notably bigger initial overhead compared to built-in renderer.
     
  3. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    31
    Then how can it be used?...

    The GPUView trace shows a simple interior scene with 15 D3D11 command buffer submissions, each with substantial GPU idle... Engine programming practices not followed?

    An engine, no matter how well it scales, or how much initial base cost, should be able to eliminate the cost if you don't need extra features and run really, really fast on simple scenes. In most cases, games are GPU-bound. Games might be slightly CPU-bound and even in those cases, GPU idle should be continuous within a frame and only appear before all GPU work instead of scattered in every submissions.
     
    Last edited: Feb 16, 2021
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    HDRP is more targeted to high end visualization, high end pc gaming and game consoles (minus weaker ones like Switch). I'd love it to scale down better as well. If you need this, URP or Built-in is better pick today.

    In addition, atm HDRP can get CPU bound easily.
     
  5. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    31
    Good use of graphics API should not result in large GPU bubbles...
     
    Last edited: Feb 17, 2021
  6. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    31
    HDRP D3D12: a simple scene with 7 boxes, I can see:
    - VSync off: many small command buffer submissions & GPU bubbles
    - VSync on: No Graphics queue bubble but many small Copy queue works are still there (Turning on VSync fixes command buffer submissions is definitely a BUG.)

    My scenes are due to some reflection probes are converted to realtime ones in HDRP.

    But the sample scene of the default HDRP template project still show many GPU bubbles.
     
    Last edited: Feb 19, 2021
  7. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    245
    This is literally the only hit on Google for "Render New Game Object" - did you work out what that was? I'm apparently doing 12 of them per frame. If I pause Unity, my framerate is in the hundreds; if I hit 'Play', the FPS drops to 12, most of the time being spent in "Render New Game Object"
     
    leavthefollower likes this.
  8. Rolloweena

    Rolloweena

    Joined:
    Aug 25, 2023
    Posts:
    1
    I found what it was in my project - a planar reflection probe. If set to update mode 'On Enable' rather than 'Every Frame' it fixes the issue but the reflections remains as desired.
     
    pierre92nicot likes this.
  9. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    86
    Hdrp has way more features than birp and most of them are enabled by default. Also, Hdrp has more complex lighting model and light loop. Because of it's complexity, Hdrp is for the game that target 60 fps only.