Version: 2022.2

QualitySettings.asyncUploadBufferSize

切换到手册
public static int asyncUploadBufferSize ;

描述

异步纹理和网格数据上传可在渲染线程上以基于时间片的方式异步上传纹理和网格数据,同时对内存和时间切片进行严格的控制。除了驱动程序必须进行的分配以外,不进行任何其他分配。为了读取数据和上传纹理及网格数据,Unity 将重用一个大小可控的环形缓冲区。

Use asyncUploadBufferSize to set the buffer size for asynchronous texture and mesh data uploads. The minimum value is 2 megabytes and the maximum value is 2047 megabytes. The buffer resizes automatically to fit the largest texture currently loading. To avoid a buffer resize (which can use extra system resources) set this value to the size of the largest texture in the Scene. If you have issues with excessive memory usage, you may need to reduce the value of this buffer or disable asyncUploadPersistentBuffer. Memory fragmentation can occur if you choose the latter option.

using UnityEngine;

public class StartupExampleScript : MonoBehaviour { void Start() { // Set Ring Buffer Size to 16 MB. QualitySettings.asyncUploadBufferSize = 16; } }

另请参阅:Quality Settings