Search Issue Tracker
By Design
Votes
12
Found in
2022.3.22f1
2023.2.15f1
6000.0.0b11
Issue ID
UUM-67532
Regression
Yes
"LockBufferForWrite: Multiple uploads in flight for buffer" message is thrown when using ComputeBuffer.BeginWrite()
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/SampleScene.unity” Scene
3. Enter the Play Mode
4. Observe the Console window
Expected result: No messages are thrown
Actual result: “LockBufferForWrite: Multiple uploads in flight for buffer” is thrown
Reproducible with: 2022.3.10f1, 2022.3.22f1, 2023.2.15f1, 6000.0.0b11
Not reproducible with: 2021.3.36f1, 2022.3.9f1
Reproducible on: Windows 11
Not reproducible on: No other environment tested
-
CKahler
Jul 11, 2024 12:36
The RESOLUTION NOTE is wrong, the bug still happens also if it is only called once per frame!
@Unity:
This bug is not resolved! -
dhtpdud528
Jun 13, 2024 10:22
2022.3.16f1, .3.29f same
-
SevenSide
Jun 06, 2024 01:09
I keep getting this error on version 2023.2.20f1
-
jacobbowley
Apr 05, 2024 14:02
Same issue
-
Mori55
Apr 04, 2024 16:07
Also occurs in version 2022.3.18f1.
-
Mike8580
Apr 04, 2024 12:40
Same issue!
-
t0bM
Apr 04, 2024 12:20
I have exactly this problem with the game "Vegas Infinite by PokerStars" in VR on Steam.
Is there a workaround for this?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Particle System only collides with one Terrain Collider at a time when Collision Type is set to 'World'
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
Resolution Note:
The mentioned warning message provides additional information to help identify when calls to LockBufferForWrite are performing slowly on D3D11.
In the case of the provided reproduction project where LockBufferForWrite is called multiple times per frame, the warning message can be addressed by lifting the call to BeginWrite outside of the loop.
Initial code:
{code:c#}
for (int i = 0; i < 10; i++)
{
Unity.Collections.NativeArray<ushort> writer = testBuffer.BeginWrite<ushort>(chunkSize * i, chunkSize);
writer.CopyFrom(chunkData);
testBuffer.EndWrite<ushort>(chunkSize);
}
{code}
Warning addressed:
{code:c#}
Unity.Collections.NativeArray<ushort> writer = testBuffer.BeginWrite<ushort>(0, chunkSize * 10);
for (int i = 0; i < 10; i++)
{
NativeArray<ushort>.Copy(chunkData, 0, writer, chunkSize * i, chunkSize);
}
testBuffer.EndWrite<ushort>(chunkSize * 10);
{code}