Help with Unity Profiler and RenderLoop

Hi!, I’m really new to using Unity’s built in profiler for testing, I’m developing a 2D game with really simple graphics, I’m trying to set my target framerate to 60fps, I’ve noticed on the profiler that the cpu is mostly waiting for the gpu with the GfxDeviceD3D12.WaitForGPU having a 15.70 ms when there is a descent amount of gameObjects on the screen, like 55+, however I dont have any special shader or particle that could have a heavy loading time.

As additional info I’m using sprites made with a .aseprite file with the embedded animations they had, this only happens when there is atleast 30+ game objects on the scene, before that it remains like at 2ms

I can see there is 118 draw calls, and batches, honestly I dont now if this is a big number or not.

The gameObjects on the scene render a 64x64 sprite.

I’ve been optimizing my code to minimize GC(It remains at 0 the whole test) collection and processing speed, but I dont really now what to do here to optimize the RenderLoop, hope somebody can help me.

Also I haven’t tested if the performance is indeed lower than 60fps on an actual build, have been basing in the unity profiler this whole time.

Thanks in advance!

SetPass calls are the actual calls made to the GPU, which is 6 in your case. That is definitely good.
All of this looks good to me.

Few notes:

  • Use dx11 as it is faster, especially for lower end/2D games
  • Check stuff like overdraw in your scene with the render debugger. This could become very heavy with 2D
  • You can always check frame debuggers and tools like RenderDoc and NSight to dive into where exactly GPU performance goes

Hey there! thanks for your suggestion, actually after changing to dx11 and doing some adjustments on the shader, now it runs at 2~3ms for the whole test :slight_smile: