Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug (Case 1254370) Calling CommandBuffer.SetGlobalConstantBuffer with null crashes the editor

Discussion in '2020.1 Beta' started by Hyp-X, Jun 9, 2020.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    431
    This is the only code I needed for the CRASH repro:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Rendering;
    3.  
    4. public class ConstantBufferTest : MonoBehaviour
    5. {
    6.     void Start()
    7.     {
    8.         CommandBuffer cmd = new CommandBuffer();
    9.  
    10.         cmd.SetGlobalConstantBuffer((ComputeBuffer) null, "FooBarConstantBuffer", 0, 0);
    11.     }
    12. }
    13.  
    Tested in 2020.1.0b11
    I haven't tested in any other version yet
     
  2. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    431
    Also crashes in 2020.2.0a13
    Does not crash in 2019.4.0f1
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hyp-X likes this.
  4. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    431
    Yay!

    This other bug I found (but didn't get to report) is fixed in beta 12:
    Graphics: FIxed DX11 backend crashing if constantbuffer values are being changed with incompatible shader bound. (1246991)

    The reason I found the null crash is that I was searching for a workaround for this 1246991 issue :)
     
    LeonhardP likes this.