Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Fusion2 WebGPU project with "Enable Native C/C++ Multithreading

Discussion in 'Multiplayer' started by malikcgcs, May 7, 2024.

  1. malikcgcs

    malikcgcs

    Joined:
    Jun 11, 2013
    Posts:
    26
    Hello,
    I've built a Unity WebGPU project with "Enable Native C/C++ Multithreading" set to True in unity 6000.0f .

    Everything works fine in the browser, but when I integrate Fusion2 with WebSocket,


    the browser notifies me with the following message: "TypeError: WebSocket.send: Argument 1 can't be a SharedArrayBuffer or an ArrayBufferView backed by a SharedArrayBuffer." How can I solve this problem?


    Note: In Unity, "Enable Native C/C++ Multithreading" works with graphics jobs but not with C#. How can I make WebSocket behave similarly to jobs?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,616
    Does this also occur in a regular WebGL app? The way you describe it makes it seem as if the issue is related to having native multithreading enabled, but it might not be. Perhaps best to (also) check with Photon for support.
     
  3. malikcgcs

    malikcgcs

    Joined:
    Jun 11, 2013
    Posts:
    26
    Thank you for your interest.

    Yes, it's the same issue. Both WebGL and WebGPU operate well without multithreading enabled, but they encounter problems when multithreading is activated. I receive the following error:

    "TypeError: WebSocket.send: Argument 1 can't be a SharedArrayBuffer or an ArrayBufferView backed by a SharedArrayBuffer."

    I've reached out to Photon about this on Discord, but I haven't received a response yet.