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

  1. 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}

Comments (7)

  1. 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!

  2. dhtpdud528

    Jun 13, 2024 10:22

    2022.3.16f1, .3.29f same

  3. SevenSide

    Jun 06, 2024 01:09

    I keep getting this error on version 2023.2.20f1

  4. jacobbowley

    Apr 05, 2024 14:02

    Same issue

  5. Mori55

    Apr 04, 2024 16:07

    Also occurs in version 2022.3.18f1.

  6. Mike8580

    Apr 04, 2024 12:40

    Same issue!

  7. 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

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.