SRPBatcher: DrawOpaqueObjects take cause massive spike on render thread

@MartinTilo

First of all, Thanks for your patience and your time checking this post:)

I dont want to mark this as a bug yet, i’m just not sure whats going on.

DrawOpaqueObjects & DrawTrasnparentObjects takes tons of time randomly from time to tim for dynamic objects that are spawned from already existence pool “no Instantiation” done during gameplay , its inifite runner game where we cycling world tiles, yet from time to time this spike take place.

This hiccup happens on all platforms I’ve tested
iPhone14 pro max
A13 samsung
Mac m1 pro max

When playing inside the editor, this spike report on EditorLoop.

With SRPBatcher enabled we have around 22draw calls. while its disabled we get only around 80

What could cause such a spike while SRPBatcher doing his job?

Thanks for your patience:)

Unity version : 2022.3.16f1
URP version : 14.0.9


Hi!
This is not related to the SRP batcher itself. This profile shows that a new shader variant is being used for the first time, and this variant is being uploaded to the GPU.

2 Likes

Special Thanks :slight_smile: @aleksandrk , your explanation what exactly what I’m I’m need to understand:))

And special thanks to @MartinTilo :))

Does this mean that the shipped shader variant in the build not contain all the shaders that being used in the game and thus I’ve to make sure that it include all the shaders? … bec I prepared the shader variant and forced to be preloaded assets , and beside checked mark Load all shaders after loading fist scene … not sure what else is missing to avoid that at before the actual gameplay start

@OmarVector you can enable “Log shader compilation” in the player settings - it will tell you which variants get compiled.

2 Likes

Thank you, that was exactly the issue:smile:

I could find the shaders that are being complied at runtime… made sure they are complied before the gameplay start, and all hiccups are gone on devices… but it still occur inside the editor itself, which It’s not a problem for me

Again, thank you so much:))

1 Like