Search Unity

Screen.SetResolution causing materials to stop rendering

Discussion in 'High Definition Render Pipeline' started by Dreamback, Jan 6, 2020.

  1. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    When I call Screen.SetResolution, most of my materials don't render, and the few that do sometimes have weird colors. This happens even if I change the resolution in one scene and the load a different scene, that second scene looks bad. Note, I am using Vulkan in Linux, Unity 2019.3.1f3.

    Is there something I need to call after Screen.SetResolution to reset the state of the HDRP or something? It's kinda weird that changing resolutions affects future scene loads.

    Edit: This is what is printed in the logs when I do it:
    Code (CSharp):
    1. requesting resize 2048 x 1084
    2. resizing window to 2048 x 1084
    3. Desktop is 3840 x 2160 @ 60 Hz
    4. InitializeOrResetSwapChain 2048x1084 hdr=0 samples=1
    5. Compute dispatch: missing UAV ID %d
    6. (Filename:  Line: 0)
    7.  
    8. Compute dispatch: missing texture ID %d
    9. (Filename:  Line: 0)
    10.  
    11. Compute dispatch: missing texture ID %d
    12. (Filename:  Line: 0)
    13.  
    14. Compute dispatch: missing texture ID %d
    15. (Filename:  Line: 0)
    16.  
    17. Compute dispatch: missing texture ID %d
    18. (Filename:  Line: 0)
    19.  
    20. Compute dispatch: missing UAV ID %d
    21. (Filename:  Line: 0)
    22.  
    23. Compute dispatch: missing texture ID %d
    24. (Filename:  Line: 0)
    25.  
    26. Compute dispatch: missing UAV ID %d
    27. (Filename:  Line: 0)
    28.  
    29. Compute dispatch: missing texture ID %d
    30. (Filename:  Line: 0)
    31.  
    32. Compute dispatch: missing UAV ID %d
    33. (Filename:  Line: 0)
    34.  
    35. Compute dispatch: missing texture ID %d
    36. (Filename:  Line: 0)
    37.  
    38. Compute dispatch: missing texture ID %d
    39. (Filename:  Line: 0)
    40.  
    41. Compute dispatch: missing UAV ID %d
    42. (Filename:  Line: 0)
    43.  
    44. Compute dispatch: missing texture ID %d
    45. (Filename:  Line: 0)
    46.  
     
    Last edited: Jan 7, 2020
    eagafonov likes this.
  2. Eric-Boise

    Eric-Boise

    Joined:
    Jul 22, 2014
    Posts:
    6
    We are having this same issue. Same version and errors
     

    Attached Files:

    • bug.png
      bug.png
      File size:
      155.1 KB
      Views:
      334
  3. Quenestil

    Quenestil

    Joined:
    Jul 2, 2014
    Posts:
    3
    I am having the same issue and I am using the LTS 2019.4.19f1.

    I have to disable the SetResolution, just to be able to avoid this issue.

    Code (CSharp):
    1. # if !(PLATFORM_LINUX && UNITY_2019)
    2.         Screen.SetResolution(resolutions[index].width, resolutions[index].height, Screen.fullScreenMode);
    3. #endif
     
  4. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, we have identified this issue and the fix for linux vulkan will come in 2020.3 LTS second revision (so not the first one). I will made a request to get it backport to 19.4 as well.
     
    DomeCreator and mariandev like this.