Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug DrawMeshInstancedIndirect broken with URP 10

Discussion in 'Universal Render Pipeline' started by sebas77, Jan 14, 2021.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    according renderdoc Graphics.DrawMeshInstancedIndirect is not defining the define PROCEDURAL_INSTANCING_ON with URP 10.x and this broke my rendering pipeline.

    this at least on windows with DX11
     
  2. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Have you submitted a bug report on this, if you're suggesting it is one? Let me know with the ID so I can raise internally for you.
     
  3. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    No I didn't, I don't want to sound like a jerk this time but you should already have an automated test to prove if I am right or wrong.
     
  4. hatless

    hatless

    Joined:
    Dec 15, 2010
    Posts:
    48
    Fix your product unity
     
  5. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    I had some spare time and I decided to work on the bug report, when I realised that nowhere in the documentation there is actually written what generates the shader define PROCEDURAL_INSTANCING_ON. One can only guess, so if I have no official information about it, I am not even sure what's the point. this define is mentioned only once in the documentation but doesn't explicitly say what enables it @UnityMaru
     
  6. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Well, a bug report is not really just so we have a log of it. It sends us key information on your setup to help us diagnose the problem. I only asked as you used the thread prefix 'bug'.

    I certainly wouldn't ask for a bug report to waste your time so I am sorry if you felt that way. More bug reports gives teams more information to look at issues so because we may have one report on the issue, more and more reports goes a long way to establish user pain and more data to analyse.
     
  7. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    thanks, but now we are beyond that point. I have now realised that my bug may be a wrong assumption, but without knowing what actually defines PROCEDURAL_INSTANCING_ON I can't know.
     
  8. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Understandable. I'll ask around internally for you and see what I can get :)
     
    sebas77 likes this.
  9. ptbs

    ptbs

    Joined:
    Mar 15, 2016
    Posts:
    2
    One possible cause for this I just encountered when porting some code from
    Graphics.DrawMeshInstanced to
    Graphics.DrawMeshInstancedIndirect is that you've missed out the pragma used by Unity to define the procedural instancing variant, a simple example is to do:


    #pragma instancing_options procedural:setup

    void setup()
    {}


    For more details see https://docs.unity3d.com/Manual/GPUInstancing.html

    Specifically:

     
    sebas77 likes this.
  10. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    interesting, I don't know what that pragma is for. We use GPUInstancer that adds:

    #pragma instancing_options procedural:setupGPUI

    shall I add the

    #pragma instancing_options procedural:setup

    too?

    (reading the documentation it doesn't seem to be the case, maybe it's a bug in GPUI then?)

    BTW I don't have this problem anymore, we are using HDRP now and I don't even remember what problem was this causing.
     
    Last edited: Aug 5, 2021