How to use the new experimental ShaderWarmup API?

Hello,

After profiling and coming to the conclusion that the preloaded shaders aren’t being warmed up on iOS, according to this documentation, I should be using the new ShaderWarmUp API which is designed to work on all graphics APIs. However, I cannot find any documentation online for how to use it.

Specifically, I have no idea how to configure the ShaderWarmupSetup.

I would really appreciate some help.

Thank you.

Hello,

Have you managed to get it working? I’m trying to use it as well, but I can’t figure out what to set as ShaderWarmupSetup for example (Unity - Scripting API: ShaderWarmupSetup)

Thanks

I am also looking for this information. Its the only step I have been unable to figure out, where can I find the vertex layouts for each graphics API?

1 Like

You can get it at runtime by reading it from a mesh Unity - Scripting API: Mesh.GetVertexAttributes

Although this is per mesh so I imagine you would want to do it for multiple mesh types (normals, no normals, skinned, un-skinned, etc).

I don’t know anything about shader warmup API, only about mesh api

AFAIK there is no warmup method that works properly, at least on mobile, if there are any guides on how to reliably shader warmup on mobile I would be very interested.

I can’t make sense of this, is the api working or not?

How do we actually use ShaderWarmup.WarmupShaderFromCollection?

I’ve been digging the docs and forums for that information as well with no success. Any new pointer as of 2022-11-10?

The old method doesn’t really work for consoles and I’d like to test it out using ShaderWarmup, but I can’t find any example code.