Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[Bug?] "Assertion failed on expression: 'm_GpuProgram'" when accessing mainTexture

Discussion in 'Addressables' started by MagicDesignEmerick, Jul 5, 2019.

  1. MagicDesignEmerick

    MagicDesignEmerick

    Joined:
    Oct 4, 2017
    Posts:
    12
    Hi, I'm trying to upgrade our loading system to be based on addressables, but I've ran in a little issue.

    I'm loading prefabs from a scriptable object that is an addressable, and then call an init function using data from this prefab before instantiating it (Loading a skeleton from Spine actually).

    When I'm loading directly the prefab all goes well, but upon switching to Addressable I get the following error when trying to access a material referenced by the prefab :

    Code (CSharp):
    1. Assertion failed on expression: 'm_GpuProgram'
    2. UnityEngine.Material:get_mainTexture()
    3.  
    While the calling code is roughly :
    Code (CSharp):
    1. if (material.mainTexture == null)
    2. {
    3.     //do stuff
    4. }
    Note that this assert doesn't seem to impact anything, besides my unit tests. Is there something I'm missing in my setup of addressable?


    I'm trying to get a simpler repro case but simplifying it makes me currently get a null ref on the access to the material even though it's not null in the prefab..