Graphics.DrawMeshInstancedIndirect CPU Overhead

I have a foliage renderer that draws instances using Graphics.DrawMeshInstancedIndirect (DMII) and am currently investigating the CPU frame time. I disabled shadow casting, receiving and light probe usage

Graphics.DrawMeshInstancedIndirect(mesh, 0, material, bounds, argsBuffer, 0, null, UnityEngine.Rendering.ShadowCastingMode.Off, false, 0, null, UnityEngine.Rendering.LightProbeUsage.Off);

Still, turning on my foliage renderer adds about 1.5 ms - 2.0 ms of CPU rendering overhead according to the standalone profiler. My foliage renderer submits around 30 DMII calls on average. 1.5 ms seems quite excessive to me. Is that normal? If so, what’s taking so long there?
The GPU frame time barely increases, from ~4.4 ms to ~4.9 ms, but it looks like Gfx.WaitForPresentOnGfxThread increases substantially (see images)

(First) foliage renderer off. (Second) foliage renderer on.


Sounds like something to do with the buffers. Also, use the RenderMeshIndirect as DrawMeshInstancedIndirect is obselete.

This might provide an example of usage compared to DrawMesh:

KeenRenderer/IndirectRendering/Assets/Plugins/KeenRenderer/Runtime/IndirectRenderer.cs at b1346a0c3137327784f9ad78bcd4aa8f1701a160 · mihairobertcr/KeenRenderer

RenderMeshIndirect is incompatible with ShaderGraph IIRC, making it pretty much useless in HDRP.

Anyways, I think this might just have been an editor thing (I thought the standalone process was supposed to prevent that?) I wasn’t able to replicate that in a build.