[1.1.0-exp.1] LockBufferForWrite: Multiple uploads in flight for buffer x of size 4194304

I get the following log at 1.1.0-exp.1 with Unity 2022.3.10f1

LockBufferForWrite: Multiple uploads in flight for buffer 000001B464BDCE78 (bufferHandle: 8137) of size 4194304. Falling back to slow path. LockBufferForWrite() should be called only once per frame on D3D11.
UnityEngine.GraphicsBuffer:LockBufferForWrite (int,int)
Unity.Rendering.SparseUploader:Begin (int,int,int) (at ./Library/PackageCache/com.unity.entities.graphics@1.1.0-exp.1/Unity.Entities.Graphics/SparseUploader.cs:683)
Unity.Rendering.EntitiesGraphicsSystem:StartUpdate (int,int,int) (at ./Library/PackageCache/com.unity.entities.graphics@1.1.0-exp.1/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:2530)
Unity.Rendering.EntitiesGraphicsSystem:UpdateAllBatches (Unity.Jobs.JobHandle) (at ./Library/PackageCache/com.unity.entities.graphics@1.1.0-exp.1/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:2001)
Unity.Rendering.EntitiesGraphicsSystem:UpdateEntitiesGraphicsBatches (Unity.Jobs.JobHandle) (at ./Library/PackageCache/com.unity.entities.graphics@1.1.0-exp.1/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:1227)
Unity.Rendering.EntitiesGraphicsSystem:OnUpdate () (at ./Library/PackageCache/com.unity.entities.graphics@1.1.0-exp.1/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:1327)
Unity.Entities.SystemBase:Update () (at ./Library/PackageCache/com.unity.entities@1.1.0-exp.1/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at ./Library/PackageCache/com.unity.entities@1.1.0-exp.1/Unity.Entities/ComponentSystemGroup.cs:723)
Unity.Entities.ComponentSystemGroup:OnUpdate () (at ./Library/PackageCache/com.unity.entities@1.1.0-exp.1/Unity.Entities/ComponentSystemGroup.cs:681)
Unity.Entities.SystemBase:Update () (at ./Library/PackageCache/com.unity.entities@1.1.0-exp.1/Unity.Entities/SystemBase.cs:418)
Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at ./Library/PackageCache/com.unity.entities@1.1.0-exp.1/Unity.Entities/ScriptBehaviourUpdateOrder.cs:523)

What kind of a scene do you have? This is definitely a bug, since OnUpdate is supposed to be called only once per frame.

I believe it’s just a environment subscene that able to run on mobile. Before that at 1.0.16, I never get this log. I only the log occasionally though at editor and seems like doesn’t make the game stop working.

New update. I get the same log at windows player runtime with extremely simple subscene.




For clarity, the behavior of the code has not changed in the latest version, but this warning was made more visible and now contains more details. In previous versions the same warning was present, but it was likely buried in the log and went unnoticed.

1 Like

I also get same logs on the same unity version.

It happens with my package for rendering sprites for dots. I use writing to ComputeBuffer through NativeArray to pass data to StructurredBuffer on GPU, I use parallel jobs to fill array with data. This logs start to appear when both game and scene windows are NOT active and at the same time I’m starting to see graphics artifacts which seems like invalidated data was passed to buffer. It is odd, because I call BeginWrite and EndWrite 1 time each frame but logs tell me opposite. I try to find source of graphic artifacts for a long time already, maybe it is related to how buffers behaves, at least it has same reproduction way.

UPD: this happens frequently when Profiler is opened and even if game window is opened

Unless something very unexpected is happening, this warning should not result in rendering artifacts, but it does mean that performance is being impacted.

So far I have not been able to reproduce this issue myself, so it seems to require some specific circumstances to happen.

1 Like

Looks like it’s regression at Unity 2022.3.10f1. It’s reproducible at both 1.1.0-exp.1 and 1.0.16

Unity 2022.3.10f1 should only change how this warning is reported (it is displayed in the Console instead of being buried in the text only log file), it should not change whatever is actually causing the warning to get issued.

Not sure whether it’s related issue but currently when u have 2 subscene that has real time light and u keep swapping between 2 subscene at Scene Asset of Subscene game object, you will see the light intensity keep increasing until crazy exposure. Looks like graphics never release properly and keep stacking.