Search Unity

Question URP loses whopping 3ms of CPU time once a single Hybrid Renderer entity is spawned

Discussion in 'Universal Render Pipeline' started by Xentarok, Mar 9, 2022.

  1. Xentarok

    Xentarok

    Joined:
    Apr 3, 2013
    Posts:
    17
    Hello!

    I've run into a pretty big problem.

    I have a game where I use URP and a hybrid DOTS approach - most things are handled in the regular way but if there's a lot of them I use the DOTS stack.

    Since it's a city builder I spawn citizens using DOTS - a very simple 10-ish vertice model with a URP simple lit material, GPU instancing enabled, entirely spawned as an entity so rendered using the hybrid renderer (latest, v2).

    The problem is, as soon as I spawn even a single one I suddenly gain like 3ms of CPU time from URP.

    Here's the profiler screenshot before I spawn entities:
    profiler_pre_spawn.png

    And here's after:
    profiler_post_spawn.png

    When I zoom in to the part that gained 3ms it seems that most of it is spent on culling? I tried turning off the model dynamic culling but that doesn't fix it.
    profiler_post_spawn_cull_zoom.png

    I'm pretty sure this problem came at some point after I started the project and wasn't there from the start - perhaps a setting I overlooked or a quirk in a URP update?

    Anyway, if anyone has any idea what might be causing this I'd be really grateful!