docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetData

    SetData(List<T>, ResizeOptions, CommandBuffer)

    Sends the given data to the GPU buffer, allocating or resizing it if necessary.

    Declaration
    public void SetData(List<T> data, ResizeOptions options = ResizeOptions.KeepExcessCapacity, CommandBuffer cmd = null)
    Parameters
    Type Name Description
    List<T> data

    The data to send to the GPU.

    ResizeOptions options

    The resizing options. The default value is KeepExcessCapacity.

    CommandBuffer cmd

    An optional command buffer to add the command to.

    Remarks

    This will call Resize(int, ResizeOptions) with the number of elements in data. Previous contents of the underlying buffer are ignored. Use a command buffer to ensure proper synchronization. If not, call the function during Update or before. Instead of using the CommandBuffer parameter, consider using the SetBufferData<T>(CommandBuffer, StructuredBuffer<T>, List<T>) extension method.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)