Search Issue Tracker
By Design
By Design in 6000.0.X
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
Comments (7)
-
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
- AI Assistant still collects telemetry with AI Gateway even when user opted out.
- BuildVectorImage(SceneInfo, Rect) is internal, and should be public
- SVGImporter preset added to the Preset Manager changes to a ScriptedImporter when restarting the project
- Built-in Standard shader variants remain stripped from the build when retained via Shader Variant Collection or Shader Build Settings
- Particles are not rendered when particle's material shader is set to URP/Particles, Soft Particles is enabled and Camera Fading is disabled
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}
Resolution Note (6000.0.X):
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}