Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Resolved DynamicBuffer ReadOnly when not resizing

Discussion in 'DOTS Dev Blitz Day 2022 - Q&A' started by Rupture13, Dec 8, 2022.

  1. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    128
    When I'm not resizing a DynamicBuffer in a job (i.e. no add element, remove element, clear, etc.), but only want to update data on an element in the buffer, do I still need to pass the DynamicBuffer with write access (pass via ref, readonly = false) to the job?
     
  2. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    78
    Hi!
    Updating data on an element in the buffer is considered as a write. So yes you need to allow write access to the buffer.
    But maybe I missed something on your question.
     
    Last edited: Dec 8, 2022
    Rupture13 likes this.