Asking some advice about spikes seen in profiler

Greetings,

When I run my scene with profiler, I can see occasional spikes in “Material.SetPassUncached”. When the spikes happen, the game stutters. I have been trying to search what this “SetPassUncached” means but found zero results. Is there any knowledgeable person who could give some advice where to look for resolution?


Thanks

1 Like

I’m encountering similar issue. It happens when a skinned mesh comes into view. Strangely I doesn’t spike all the time, but it’s very noticeable when it does. Anyone knows how to fix this? Thanks

Big bump here…

In my case it happens in a scene with many GameObjects (4900+). And if I try to switch their material every frame, it takes nearly 20 ms.

It’s getting obvious that nobody seems to know about this?

Hey there!

I’m randomly getting a pretty big spike caused by Material.SetPassUncached - has anybody also encountered it while using Unity 5.2.2p2? Maybe someone knows what causes it? Any tips will be appreciated.

Thanks!
Tom

I’m getting these heavy spikes as well, using Unity 5.3.0f2

Anyone?

Same here… I’m using Unity 5.3.0f4… But this came very sudden… I haven’t have that issue yesterday evening when I closed Unity. Today I opened Unity and run my scene without any changes and this spikes appear…
Somehow Unity does this strange things only if you are close to the release deadline… :wink:

Are you all overbooking your GPU memory? Have you tried lowering your texture sizes in the quality settings?

We have also just started seeing this on 5.2.2p3, similar to CL_HG just before a deadline (coincidence?).

It can seemingly happen fairly randomly when first rendering a new object that has not been rendered before. It seems like Unity is swapping something in/out. I presume that there is something with a finite pool size internally in Unity that we are managing to exhaust.

I’m curious if anyone have noticed these spikes in the build? I wonder if it is occurring only in the editor.

I haven’t tested it in depth yet, but for me preloading the shaders seems to fix it so far.

We are also experiencing this issue since Unity 5.something heh. We’re not sure which update it may have started it but have been experiencing it for months on end and haven’t been able to sort it (on Unity 5.3.4 now). Same error in profiler on a bunch of materials, around 70%+ on Total and Self and causing awful lag spikes (120+ Time MS).

Same here on 5.3.5p5 (5.3.5 the same). Found anything guys?
Thought that it was compiling the shader, but it’s like in that screenshot - the spike is inside the SetPassUncached.

Also seeing this, v5.4.0f3 :frowning: :frowning:

I’m having this too, and I’m also yet to fix the fact I’m over my shader keyword limit. I wonder if anyone else is hitting the keyword limit that is getting this problem? Maybe Unity is juggling keywords or something on a new material/shader load, I don’t know? I’m getting 1000ms spikes!

Same here and we have hit our shader limit and cannot seem to fix it. Lots of people having issues with this shader limit problem, really wish Unity would realize how important of an issue it is and bring it to the front of their schedule of issues/workarounds to address.

@Aras has said that the shader limit will be increased to 256 in 5.4.1.

1 Like

Oh thanks I missed that, wonderful news!

Latest update from Aras is that it’s not confirmed for 5.4.1 yet:
http://forum.unity3d.com/threads/solved-64-keyword-limit-questions.252750/page-2#post-2697499

Sorry, I’m inexperienced with the shader keyword limit issue. How do I know if this is affecting my project? Although I’m doubtful about it, as I’m only using Unity’s built in shaders.