Unity is reporting a totally reasonable number of draw calls in the frame capture during one of our most complex scenes (90-100) using the SRP Batcher. Stepping through it, it’s about what I would expect it to do. The metal frame capture is reporting 2,200+ and eating up to 3ms of our CPU time because of it.
The method of creation for the objects is to simply instantiate them through remote data received with a material on each object that has the same shader has nearly every other object. All object are simply mesh renderers rendering planes with our materials and textures attached.
We are using shadergraph and don’t seem to be doing anything too complex. All of our shaders show SRP Batcher compatible:
I do not believe that is correct. Considering Static and Dynamic Batching are methods of reducing draw calls, SRP Batcher would be a pretty misleading name if it didn’t involve batching Also, when I turn it off, the Editor ends up with about as many draw calls as the mobile device is reporting. Turning it off does not affect the mobile build at all.
Regardless of the intent of the SRP Batcher, it significantly reduces draw calls from Unity when using the above simple shadergraph shaders, and it is not reflected on my metal devices. This includes an iPhone XS and a build on the exact mac machine I’m running the Unity Editor on. No batching seems to be occurring at all for both iOS and Mac builds, or if there is it’s negligible.
This could also be me not understanding what the SRP Batches are in the Frame Debugger in Unity. The window functions as if it’s a single draw step in the frame, so it looks like it only has a hundred draws, but maybe that’s incorrect.
EDIT: I’ve found when using ProfilerRecorder.StartNew(ProfilerCategory.Render, "Draw Calls Count"); I get the same value of draw calls in editor vs my build.
So I suppose my updated question would be, what’s the disconnect here between the Frame Debugger and the actual Draw Calls? The SRP batcher very well and as I would expect in the frame debugger, but clearly we still have many more draw calls than is acceptable on mobile. Is there a reason there’s no batching of drawcalls with the shaders provided? Marking the objects as static seems to have no effect
You were correct in that the SRP Batcher has it’s own draw call count within, can’t believe we missed that. It’s different than working on the native frame debuggers so we must have over looked. Will create a new thread with a more correct question.