Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Help Wanted A quesstion about stream aligned.

Discussion in 'Netcode for GameObjects' started by qpuilie, Jun 21, 2021.

  1. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    59
  2. luke-unity

    luke-unity

    Unity Technologies

    Joined:
    Sep 30, 2020
    Posts:
    182
    If your stream is unaligned (lets say you wrote 3 bits already) and then you write something like a ulong (8 bytes) this ulong will not just be written into a single memory location but instead 7 bytes and 5 bits will be written into the first location and the remaining 3 bits into the next one. This can be much slower because the CPU needs to perform more than twice the operations.
     
    qpuilie likes this.
  3. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    59
    Thanks for your answer!;)
     
unityunity