Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

SRP Batcher disables instancing?

Discussion in 'Universal Render Pipeline' started by Kolyasisan, Apr 21, 2020.

  1. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    391
    Today noticed a dubious behaviour when using SRP Batcher. Happens on HDRP, URP and my custom render pipeline (tested on Unity 2019.3.10f1). Instancing is seemingly disabled when using SRP Batcher (confirmed via renderdoc, the draw call count is increased in the Stats tab in the Game View, also shows "Saved by batching" as a negative number.). Disabling SRP Batcher makes instancing work again. Can anyone please clarify if this is intended? If so, why is instancing outright disabled when drawing with SRP Batcher?
     

    Attached Files:

  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,653
    It's intended. Because SRP batcher it's replacement of instancing. There are many thread discussing that topic, negative numbers for saved by batching etc.
     
  3. jawad_ahmad

    jawad_ahmad

    Joined:
    Apr 28, 2017
    Posts:
    35
    I've noticed this too. My guess is that the SRP Batcher is more optimal than instancing, and so it is not needed anymore. Number of draw calls isn't inherently bad as long as you sort by material and group the draw dispatch commands. The previous cost would have been all related to state setup more than the actual draw call itself. This is where instancing provides a benefit. But instancing has the overhead of building an instancing buffer, and so I suspect, compared to the SRP Batcher, it is not as optimal.