Search Unity

GPU Instancing wont work.

Discussion in 'High Definition Render Pipeline' started by DanielRiches, Nov 3, 2021.

  1. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    166
    Using 2021.2.0f1
    Using HDRP 12.1.0
    SRP Batcher is enabled in Pipeline Settings
    GPU Instancing is selected on material

    Material uses a Shader Graph which has Vertex Displacement wind sway

    WHY is this not batching? I go to the profiler and get some silly "Node Have Different Shaders" reason which looks like a child wrote it and is as clear as mud, any chance Unity could come up with a coherent sentence to describe a problem?

    upload_2021-11-3_12-22-59.png

    upload_2021-11-3_12-23-46.png

    upload_2021-11-3_12-26-9.png

    It's becoming irritating that I have to launch a full on investigating into something that should simply work the first time, if SRP Batcher is on, and GPU-I is checked then these materials should be batched.
     
  2. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    529
    It's a batch of 317 instances. The message just tells you why this batch is not merged with the SRP batch above it in the list. Different shader means: shader or keywords not matching.
     
  3. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    166
    In the second screenshot its showing that nothing is being batched together, why?

    All these use exactly the same shader
     
  4. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    166
  5. DanielRiches

    DanielRiches

    Joined:
    Nov 23, 2019
    Posts:
    166
    NVM. I disabled the batcher and now it apparently works...

    upload_2021-11-3_13-3-0.png
     
  6. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    529
    Well, Unity should probably have used a new word for batches in SRP context...

    The SRP version looks like it works as intended. SRP draw calls are much much cheaper than non-SRP draw calls. Did you compare performance?