Search Unity

RenderTexture.SetActive Profiler Spikes

Discussion in 'Editor & General Support' started by Mr Turnip Head, May 10, 2012.

  1. Mr Turnip Head

    Mr Turnip Head

    Joined:
    Feb 9, 2010
    Posts:
    34
    Hi.

    I was wondering is anyone could help me work out why I get big spikes on the GPU. In the profiler about every 50th frame RenderTexture.SetActive jumps up to around 99% of the total GPU allocation and lasts just one frame.

    I am not sure where or why this gets called? I don't have any effects on the camera that I am aware of.
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I have been seeing this behavior since the 4.0 Beta. RenderTexture.SetActive on the profiler eats up the most of the GPU cycles. As you mentioned, it does spike but it is also a constant consuming more than Drawing.

    This behavior did not occur with the prior 3.5+ versions of Unity. This behavior gets worst when using DX11.

    I have filed a bug report on this but have not heard back.

    With just an empty scene, this behavior is visible on the Profiler.

    If you look at the attached image, this is an empty scene using DX11. RenderTexture.SetActive is consuming a lot already but look at those spikes which makes it even worst.
     

    Attached Files:

    Last edited: Nov 28, 2012
    futurlab_xbox likes this.
  3. sparrow

    sparrow

    Joined:
    May 6, 2012
    Posts:
    17
    I have the exact same problem
     
  4. TomH

    TomH

    Joined:
    Jul 10, 2012
    Posts:
    41
    Having the same issue here. Have you recieved any feedback on your reported bug?
     
  5. tasadar

    tasadar

    Joined:
    Nov 23, 2010
    Posts:
    290
  6. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    On December 3rd Unity QA said they had been able to reproduce it but I haven't seen any fixes yet for this.
     
  7. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    what is your case number? I would advise to drop case number in forum post if you have a bug submitted. It will help unity guys to check on it
     
  8. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Case # 488857
     
  9. God-at-play

    God-at-play

    Joined:
    Nov 3, 2006
    Posts:
    330
    I'm running into this bug as well on a 4.3 project. Here's an older thread with a mention of the issue: http://forum.unity3d.com/threads/122080-RenderTexture-SetActive()-but-no-Image-effects-used

    ---
    EDIT: Restarting my computer made the performance hit mostly go away. But I'm still concerned over how much time RenderTexture.SetActive() takes up considering I'm not using post effects anywhere.
    ---

    What has happened to me was that I imported a few files to view a (very expensive) post effect, which included using RenderTextures, then I deleted the files. However, the performance hit equivalent to processing the effect still seems to be happening, at least to some degree. Very disturbing.
     
    Last edited: Dec 20, 2013