参考 read()

read()

This feature requires the p5.webgpu.js addon.
此 API 是实验性的

其行为可能在 p5.js 的未来版本中发生变化。

Reads the current contents of the list back to JavaScript.

It returns a Float32Array for float lists, or an array of plain objects for struct lists.

Note: This is a GPU-to-CPU read. Calling it frequently can be slow.

示例

语法

read()

参数

返回值

Promise<Float32Array|Object[]>:

相关参考