Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    129
    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:
    97
    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.