Enabling GPU Resident Drawer = Completely unstable editor

Hi everyone,

I’ve encountered a significant issue with Unity 6 Preview related to the GPU Resident Draw feature. Whenever I enable this feature, the editor becomes extremely unstable. I’m working on a large game project that I’ve been developing for over a decade, which makes troubleshooting challenging. Despite my efforts, I haven’t found much information online, so I’m reaching out here to see if anyone else has experienced similar problems or has any insights.

Here’s a summary of the issues I’m facing:

  1. Frequent Crashes: The editor crashes every 30 minutes, particularly when exiting play mode. Fortunately, tools like HotReload and PlayModeSave help me continue development in play mode, but this is far from ideal.
  2. Build Failures: Unity crashes towards the end of the build process. I’ve managed to mitigate this by closing all scenes and reducing the game window resolution to 16:9, but it’s unreliable and adds extra steps.
  3. Level Streaming Tool Issues: I use a custom level streaming tool to handle large levels (500k+ prefabs), loading and unloading scenes as needed. After a few iterations, the game build crashes consistently.
  4. Editor Instability: Simple actions like clicking or pressing undo can crash the editor.

Despite these issues, enabling GPU Resident Draw offers a 2-4x performance boost, which is why I’ve continued using it despite the instability. After several weeks of troubleshooting, I found that disabling GPU Resident Draw basically eliminates the crashes.

The crash logs consistently show a Null Reference Exception in Burst. Given the size and complexity of my project, pinpointing the exact cause is challenging. However, since the problems vanish when GPU Resident Draw is disabled, I suspect there might be a bug related to this new feature.

Has anyone else encountered similar issues with GPU Resident Draw, or does anyone have suggestions on how to further diagnose this problem?

Thanks in advance for any help or insights!

1 Like

Ok an Update to my situation.

I’ve managed to code my way around the problem putting it here in case anyone ever has the same issue, basically I set the GPU Resident Draw to disable in the scriptable object and then Enable it at runtime like this:

public HDRenderPipelineAsset pipelineAsset;

pipelineAsset.gpuResidentDrawerMode = GPUResidentDrawerMode.InstancedDrawing;

That solves the editor instability problem. Then when I want to load a scene I disable it like so and then re-enabled it after the scenes have loaded:

pipelineAsset.gpuResidentDrawerMode = GPUResidentDrawerMode.Disabled;

then when I exit play mode I disable it again using

   static GameEnginePlayState()
    {
        EditorApplication.playModeStateChanged += PlayModeStateChanged;
    }

    private static void PlayModeStateChanged(PlayModeStateChange state)
    {
        pipelineAsset.gpuResidentDrawerMode = GPUResidentDrawerMode.Disabled;
    }

This solves all the crashing, but UNITY you may want to have a look at this, cos I’m guessing a lot of people using this will be streaming in big levels.

Thanks for the feedback, this does not look great indeed.
This does not seem to be known on our side.

Do you have by any chance the crash report or even better can you submit a report using the unity bug reporter ? :pray:

Even if you have a hacky workaround, it’d be great to have a look at this because you might not be the only one as you said !