Game freezes/crashes only when built (never in the editor), and only on certain machines.

My game is freezing and/or crashing only when built. There has never been a freeze or crash in the editor, and I think it has something to do with DX11. The game will periodically freeze on certain machines, and while doing so will spam:

“d3d11: attempt to lock null buffer”

I think this generally happens when the player fire projectiles very rapidly (even though the projectiles are destroyed very quickly and GC is performed every 30 frames)

Using -force-d3d9 solves the issue on affected machines (as far as I know), and using DirectX 12 does not.

The game will freeze for sometimes multiple seconds, and will either eventually resume or remain frozen (however, the game can still be heard continuing in the background and responding to inputs) before eventually crashing (although a crash log is generally not created). In situations where it remains frozen, the log is spammed with:

"(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/GfxDeviceD3D11.cpp Line: 1547)

d3d11: attempt to lock null buffer

d3d11: attempt to lock null buffer

RenderTexture: Resolving a destination texture that is NULL."

If it helps, I am using a render texture in certain scenes, but not in the scenes where the crash occurs.

I’ve searched for a long while as to the cause of the issue, and so far the only solution I have found is per-machine (using -force-d3d9). Is there anything I can do to solve this problem for all machines without needing to pass additional command line arguments?

Any help is appreciated, as I’ve sort of hit a brick wall with this.

Thanks.

I have exactly the same problem. Did you find any solution for that?

I’m walking up walls with that! In the editor everything works fine. But in the win build it is not.
When i place a skinned mesh renderer in the scene dynamically and try to render a highlight with a second camera, it freezes without an error drawn in the debug console.

In the player.log it’s written:

d3d11: attempt to lock null buffer
.
.
.
…in a number of lines.

The thing is: Everything worked for 5 years now without problems! I now switched to linear shading with an deffered render pass and now it’s not working anymore - like i said…only in the build.

How is such a mess to be fixed when i get no errors displayed to work with?