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.
  2. Dismiss Notice

Android shader error

Discussion in 'UI Toolkit' started by CabinIcarus, Aug 25, 2020.

  1. CabinIcarus

    CabinIcarus

    Joined:
    May 24, 2017
    Posts:
    72
    Unity Version: 2020.2.0a16.2180
    UI Toolkit Version:1.0.0-preview.6

    I upgraded from 0.0.4-preview to the latest 1.0.0-preview.6, Android device run, appear the Shader arg null exception.
    Code (CSharp):
    1. ArgumentNullException: Value cannot be null.
    2. Parameter name: shader
    3.  
    4. UnityEngine.Material..ctor (UnityEngine.Shader shader) (at <00000000000000000000000000000000>:0)
    5. UnityEngine.UIElements.UIR.UIRenderDevice.get_vertexTexturingIsAvailable () (at <00000000000000000000000000000000>:0)
    6. UnityEngine.UIElements.UIR.UIRenderDevice.get_defaultShaderInfoTexFloat () (at <00000000000000000000000000000000>:0)
    7. UnityEngine.UIElements.UIR.RenderChain.Constructor (UnityEngine.UIElements.IPanel panelObj, UnityEngine.UIElements.UIR.UIRenderDevice deviceObj, UnityEngine.UIElements.UIRAtlasManager atlasMan, UnityEngine.UIElements.UIR.VectorImageManager vectorImageMan) (at <00000000000000000000000000000000>:0)
    8. UnityEngine.UIElements.UIR.RenderChain..ctor (UnityEngine.UIElements.IPanel panel) (at <00000000000000000000000000000000>:0)
    9. UnityEngine.UIElements.UIRRepaintUpdater.CreateRenderChain () (at <00000000000000000000000000000000>:0)
    10. UnityEngine.UIElements.UIRRepaintUpdater.OnPanelChanged (UnityEngine.UIElements.BaseVisualElementPanel obj) (at <00000000000000000000000000000000>:0)
    11. System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
    12. UnityEngine.UIElements.BaseVisualTreeUpdater.set_panel (UnityEngine.UIElements.BaseVisualElementPanel value) (at <00000000000000000000000000000000>:0)
    13. UnityEngine.UIElements.VisualTreeUpdater.SetUpdater[T] (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <00000000000000000000000000000000>:0)
    14. UnityEngine.UIElements.VisualTreeUpdater.SetDefaultUpdaters () (at <00000000000000000000000000000000>:0)
    15. UnityEngine.UIElements.VisualTreeUpdater..ctor (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <00000000000000000000000000000000>:0)
    16. UnityEngine.UIElements.Panel..ctor (UnityEngine.ScriptableObject ownerObject, UnityEngine.UIElements.ContextType contextType, UnityEngine.UIElements.EventDispatcher dispatcher) (at <00000000000000000000000000000000>:0)
    17. UnityEngine.UIElements.BaseRuntimePanel..ctor (UnityEngine.ScriptableObject ownerObject, UnityEngine.UIElements.EventDispatcher dispatcher) (at <00000000000000000000000000000000>:0)
    18. UnityEngine.UIElements.RuntimePanel..ctor (UnityEngine.ScriptableObject ownerObject) (at <00000000000000000000000000000000>:0)
    19. UnityEngine.UIElements.RuntimePanel.Create (UnityEngine.ScriptableObject ownerObject) (at <00000000000000000000000000000000>:0)
    20. UnityEngine.UIElements.UIElementsRuntimeUtility+CreateRuntimePanelDelegate.Invoke (UnityEngine.ScriptableObject ownerObject) (at <00000000000000000000000000000000>:0)
    21. UnityEngine.UIElements.UIElementsRuntimeUtility.FindOrCreateRuntimePanel (UnityEngine.ScriptableObject ownerObject, UnityEngine.UIElements.UIElementsRuntimeUtility+CreateRuntimePanelDelegate createDelegate) (at <00000000000000000000000000000000>:0)
    22. UnityEngine.UIElements.PanelSettings.CreateRelatedRuntimePanel () (at <00000000000000000000000000000000>:0)
    23. UnityEngine.UIElements.PanelSettings.get_m_Panel () (at <00000000000000000000000000000000>:0)
    24. UnityEngine.UIElements.PanelSettings.get_visualTree () (at <00000000000000000000000000000000>:0)
    25. UnityEngine.UIElements.PanelSettings.AttachAndInsertUIDocumentToVisualTree (UnityEngine.UIElements.UIDocument uiDocument) (at <00000000000000000000000000000000>:0)
    26. UnityEngine.UIElements.UIDocument.AddRootVisualElementToTree () (at <00000000000000000000000000000000>:0)
    27. UnityEngine.UIElements.UIDocument.ReactToHierarchyChanged () (at <00000000000000000000000000000000>:0)
    28. UnityEngine.UIElements.UIDocument.OnTransformParentChanged () (at <00000000000000000000000000000000>:0)
    29. UnityEngine.Transform.SetParent (UnityEngine.Transform p) (at <00000000000000000000000000000000>:0)
    30. System.Linq.Enumerable+<DistinctIterator>d__68`1[TSource].System.Collections.IEnumerable.GetEnumerator () (at <00000000000000000000000000000000>:0)
    31. System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) (at <00000000000000000000000000000000>:0)
    32. System.Threading.ContextCallback.Invoke (System.Object state) (at <00000000000000000000000000000000>:0)
    33. System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
    34. System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <000000000000
     
  2. CabinIcarus

    CabinIcarus

    Joined:
    May 24, 2017
    Posts:
    72
    I added the runtime shader in the UIToolkit/Shaders directory to the Graphic shader list to solve this problem
     
  3. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    733
    Hello,

    When you upgraded did you keep using PanelRenderer or did you upgrade your scene to use UIDocument and Panel Settings?
     
  4. CabinIcarus

    CabinIcarus

    Joined:
    May 24, 2017
    Posts:
    72
    UIDocument and Panel Settings
     
  5. Wobbers

    Wobbers

    Joined:
    Dec 31, 2017
    Posts:
    55
    Where did you find this shader? I am getting the same exception in a windows build and with a different callstack, but it's worth a try.
     
  6. CabinIcarus

    CabinIcarus

    Joined:
    May 24, 2017
    Posts:
    72
    packages/ui tookit runtime/shaders
     
    Wobbers likes this.