Search Unity

Graphics.Blit Tiled GPU perf. warning: RenderTexture color surface was not cleared/discarded

Discussion in 'General Graphics' started by CDF, Jul 27, 2017.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    What am I doing wrong here?

    I have a script that runs on the Update loop. I have 2 RenderTexture assets. I just want to blit into them with a material. Yet I get Tiled GPU Perf warnings.

    I don't want to discard the contents, I want to keep the contents :mad:

    Code (CSharp):
    1. private void Update() {
    2.  
    3.         if (renderTexture && heightTexture && material && heightMaterial) {
    4.  
    5.             //heightTexture.DiscardContents();
    6.             //renderTexture.DiscardContents();
    7.  
    8.             Graphics.Blit(null, heightTexture, heightMaterial, 0);          
    9.             Graphics.Blit(heightTexture, renderTexture, heightMaterial, 1);
    10.  
    11.             material.SetTexture(Uniforms.HeightTex, renderTexture);
    12.         }
    13.     }
    Even if I call DiscardContents, I still get these warnings. Why? I can't even use Temporary ones either, still warns.

    How are you supposed to use Graphics.Blit into a texture without these perf warnings?
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Thanks
     
  4. wechat_os_Qy01_D5oT6WWTPDtOYBTDi1n8

    wechat_os_Qy01_D5oT6WWTPDtOYBTDi1n8

    Joined:
    Nov 19, 2019
    Posts:
    3
    You do it as follows: Just change setting of Unity: Edit -> Graphic Emulation -> No Emulation
     
    Sugiyono and Matinhamamigh like this.