Search Unity

Question How can I determine if a compute shader failed to compile in 2020.3?

Discussion in 'Shaders' started by joshuacwilde, Mar 20, 2023.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    727
    I see that newer versions have IsSupported(), but 2020.3 does not support this. I need an alternative. We are getting crashes on devices where compute shaders fail to compile, and we need to detect this before crashing.

    Thanks.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hi!
    It looks like this API hasn't been backported. It's trivial enough, so we'll do it soon.
    I don't think there's a solid alternative currently.
     
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    727
    That would be nice, it's a critical issue for us. Would that be in the next minor release then?
     
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hopefully. I'll let you know when we know where it lands.
     
    joshuacwilde likes this.
  5. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    727
    Thank you, I would appreciate it
     
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,014
    Hey, so I double-checked this API, and it's not checking whether it failed to compile or not. It checked whether it meets the HW requirements declared in the shader - there were none in 2020.3, which is why the API is not there.
    Now, it indeed checks whether the kernel is available before checking the requirements :D

    I think it makes sense to fix the crash, though. Can you please submit a simple repro of this? I'll try to expedite the processing if you post the bug number here.