Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to fix compute shader errors?

Discussion in 'General Graphics' started by PsiconLab, Sep 21, 2023.

  1. PsiconLab

    PsiconLab

    Joined:
    Oct 9, 2017
    Posts:
    27
    I'm building VR for Meta Quest 2 using Unity 2021.3.2f1 and URP and the Depthkit package for rendering volumetric captures. Everything was going fine until I had some issues with static/dynamic texture batching and I started to tinker about with SRP Batching.

    All of a sudden it stopped rendering the Depthkit meshes. I can see other objects in the VR just not the meshes. I'm working with Depthkit meshes which render them from a video file. The shaders were created in Shader Graph based on the samples created by Depthkit.

    This problem happened on one quest, then I moved to working on a second which was fine for a bit but then did the same.

    The problem exists across different applications - I've built multiple projects with totally different names etc and they all have the same problem - none of them render the meshes, and they all give the same error in the Android logs. Same problem using SRP and URP.

    The logfile from the Android app keep giving me this (I'm using the Depthkit package).

    Code (CSharp):
    1. 06:57:46.653UnityDepthkitCoreMeshSource.compute: Kernel at index (9) is invalid
    2. 06:57:46.653UnityDepthkit.Util:DispatchGroups(ComputeShader, Int32, Int32, Int32, Int32)
    3. 06:57:46.653UnityDepthkit.CoreMeshSource:OnGenerate()
    4. 06:57:46.653UnityDepthkit.DataSource:Generate()
    5. 06:57:46.653UnityDepthkit.Clip:DoGenerate()
    6. 06:57:46.653UnityDepthkit.Clip:LateUpdate()
    7. 06:57:46.653Unity
    8. 06:57:46.653Unity[ line 1164117352]
    I appreciate this is a Depthkit related error but I need to get this working so how do I go about trying to fix compute shader errors? I feel like I've pretty much ticked and unticked every option in the Project Settings with no success.

    Here's what I've tried, none of which has worked...
    • I've renamed the shaders and changed them
    • I've saved tracked shaders to a Shader Varient Manifest asset
    • I built and installed a previously working version from a totally separate PC - the meshes still do not render
    • Tried disabling "Caching Preprocessor" in Editor settings
    • Tried deleting “ScriptableAssemblies” and “ShaderCache” folders from"Library" folders.
    • In Preferences I cleared the GI cache
    • Tried a newer version of Unity (2021)
    • I've factory reset the Quest
    • I've changed the Android API level

    Anything other suggestions on anything else I can try would be welcome!

    Is it related to URP/SRP?
    Is it linked to the Quest somehow?
    Is it linked to some shader compilation/caching somehow?
    Is it linked to video decoding?

    I'll just repeat - this was working fine with the Depthkit package and Unity version I was using with the Android build settings I had - I could see the meshes and was working on the shaders - then all of a sudden - it stopped rendering them! WHY?

    Thanks for any help
    Ben
     
    Last edited: Sep 21, 2023
  2. PsiconLab

    PsiconLab

    Joined:
    Oct 9, 2017
    Posts:
    27
    Ok, turns out that this was a recent Quest 2 update that killed the rendering.

    Luckily Depthkit have found a fix - available in their updated (phase 9-2-RC) package.