"PrepareRenderTarget" make frame rate down

My game get a low fps, so I check any performance problem.
I found when transparent object in my camera view, the “PrepareRenderTarget” will take 20ms
After an afternoon of testing, I found the problem source.
the “Opaque Texture” option!
When I active “Opaque Texture” option, PrepareRenderTarget will coming.

This problem only happens on iphone 6sp.
When I test in iphone xs max, any thing is ok

so. the conditions under which the problem recurs are:

  1. old ios device (I only have iphone 6sp,not other but Understanding "ScheduleGeometryJobs" and "PrepareRenderTarget" in profiler )
  2. transparent object in camera view. (surface type)
  3. Actived “Opaque Texture” option.

unity version 2019.4.8
urp version 7.4.3


6212963--682829--QQ图片20200817183954.png
6212963--682829--QQ图片20200817183954.png

1 Like

update

In my case, I go from 60+ fps (16ms) to less than 15fps (84ms) every second or so with PrepareRenderTarget taking the majority of the time (69ms). For me, however, it’s happening on a Macbook Pro, and I have “Opaque Texture” already disabled.

It would be nice if there were some hints as to where to look since there’s little available searching on Google.

when I use vlb https://assetstore.unity.com/packages/vfx/shaders/volumetric-light-beam-99888?_ga=2.88367579.1308874314.1596881830-2123076203.1593714283

I’ve found a way to reproduce 100% and seem to have found the reason why

this is my iphone 6sp
6258302--690230--upload_2020-8-30_5-33-9.png
A large ms by PrepareRenderTarget

this is other mobile device,it’s work well

No any PrepareRendertarget, there only DrawBuffersBatchMode.

This means that in some cases DrawBuffersBatchMode is replaced by the PrepareRenderTarget

6258302--690242--unnamed.png

2 Likes

I found this problem after so much test
https://discussions.unity.com/t/806611

But unity doesn’t seem to care.

Sorry for the delay here, I’ll push this post over to see if the team can have a look!

Have you tried to downsample the Opaque texture?
We’re downsampling to 4x on iOS.

Sorry for reviving this thread. We encounter this issue on 1st gen iPad Pro 9.7
with iOS 11.4.1, built with Unity 2019.4.22
While we are still using legacy rendering pipeline, we encountered similar PrepareRenderTarget spike

I managed to capture spike with Instrument, but unable to read the callstack since I have no access to Unity and Metal driver source code. Wonder if this capture would help. Thank you.

any update ?