Search Unity

DrawMeshInstancedIndirect generating more SetPass calls than expected

Discussion in 'General Graphics' started by Chris-Herold, Aug 18, 2020.

  1. Chris-Herold

    Chris-Herold

    Joined:
    Nov 14, 2011
    Posts:
    116
    Trying to understand a weird issue with DrawMeshInstancedIndirect and pointlights.

    Example:
    Legacy rendering pipeline
    1 mesh with single material with 2 passes, opaque forwardbase + forwardadd.

    With a single directional light the numbers are as expected: 2 setpass calls
    But with a single pointlight that number jumps to 20 !
    Shadow cast/receive is off, no GI, no lightmaps etc.

    The Frame Debugger shows a ton of extra draw calls in the Transparency pass regardles of which pass i disable in the shader.
    Why would there be any transparent draw calls when the only shader pass is Opaque ForwardBase?
    Any why so many?

    Does anyone have any idea what's wrong with DrawMeshInstancedIndirect + pointlights?
     
    Last edited: Aug 18, 2020
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Can you submit a bug with a small repro? It will make it easier for us to investigate.

    Please reply here with the case number once you have it.

    Thanks!
     
    Chris-Herold likes this.
  3. Chris-Herold

    Chris-Herold

    Joined:
    Nov 14, 2011
    Posts:
    116
    As usual, i'm failing to reproduce this issue in a new barebone project.
    I'll file a bug once i found the culprit... hopefully. Thanks for the response!
     
    richardkettlewell likes this.