Search Unity

Profiler: PrepareRenderTarget eating up MS

Discussion in 'Universal Render Pipeline' started by NateReese77, May 7, 2020.

  1. NateReese77

    NateReese77

    Joined:
    Jun 14, 2017
    Posts:
    26
    Hello,

    We are seeing the Render PostProcessing Effects / UberPostProcess / PrepareRenderTarget eating up a ton of frame time in the profiler every couple of frames. Has anyone else experienced this? We have a pretty small post stack with Bloom, Color Adjustments, and Shadows Midtones Highlights enabled.

    Thanks!
     

    Attached Files:

  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    How does that look like in Timeline view and with all categories enabled in the charts? I have a feeling that some time of preparing the render target is spend waiting for a free Screenbuffer (can't remember the "scientific" name for this) from the OS because it is still used for the previous frame. since your overall frame time is 33 ms, i.e. 30 fps, you might be vSync bound? Maybe you miss the first vBlank at 16.66ms? Timeline view might shed some light on this.
     
  3. GAMEDIA_Justin

    GAMEDIA_Justin

    Joined:
    Mar 29, 2017
    Posts:
    19
    We're seeing the same kind of issues, where PrepareRenderTarget of the UberPostProcess suddenly takes a huge amount of time. From ~0.1ms to more than 20ms, sometimes even 40ms. This will then take down the main thread with it.

    Here's a video of the profiler Timeline with all categories enabled: https://drive.google.com/file/d/1JXCjTXrtJ-aqKrtCAkCmDy-WuZ0syfkU/view

    The camera stayed at the same position, as seen by the flat line in the Rendering graph.

    The iPhone was heating up a little bit, even though the game was well within it's frame budget. Maybe iOS started to throttle the game? But I wouldn't expect to see a x200 slowdown on just the UberPostProcess.

    Unity 2021.3.31f1
    URP 12.1.12
    iPhone X with iOS 16.2
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    that would be my first assumption here. Try placing the phone between (or two or on top of one) cooling packages (or in a fridge) and check if that prolongs the average time until it starts doing that. Always start from a phone that was fully cooled down first (e.g. in the fridge).

    (Depending on water resistance levels and humidity in the fridge, maybe put it in a plastic bag?)