Search Unity

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

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

  1. MagicDesignEmerick


    Oct 4, 2017
    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()
    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..