Search Unity

Question Unity 2021 iOS Metal Hang with Mobile/Diffuse shaders

Discussion in 'iOS and tvOS' started by yathish_unity846, Nov 4, 2022.

  1. yathish_unity846

    yathish_unity846

    Joined:
    Jan 20, 2021
    Posts:
    1
    We are upgrading our game from Unity 2019.4.36f1 to 2021.3.11f1. In new iOS builds of 2021, we are facing the following hang with metal API,

    This is when assigning material with Mobile/Diffuse from an asset bundle built with Unity 2019.4.3f1 in runtime. Please help us with a resolution as we are blocked on the release pipeline with this.


    Code (CSharp):
    1. -[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5252: failed assertion `Draw Errors Validation
    2.  
    3. Fragment Function(xlatMtlMain): missing buffer binding at index 0 for FGlobals[0].
    4.  
    5. dyld4 config: DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
    6.  
    7. -[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5252: failed assertion `Draw Errors Validation
    8.  
    9. Fragment Function(xlatMtlMain): missing buffer binding at index 0 for FGlobals[0].
     
  2. gabrieloc

    gabrieloc

    Joined:
    Apr 6, 2014
    Posts:
    49
    I was able to narrow down the issue to the fact I had Unlit shader graphs. Fixed by converting them to Lit, but still curious if there's a way to do Metal validation inside Unity to catch these issues earlier.

    There's an
    enableMetalAPIValidation
    flag you can set on
    UnityEditor.PlayerSettings
    but that doesn't seem to do anything.