Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    421
    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:
    421
    Also crashes in 2020.2.0a13
    Does not crash in 2019.4.0f1
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

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

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    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.