在指定索引从数组值创建缓冲区。
template<typename T> bool BufferFromArray( const int buffer_index, // 缓冲区索引 T &data[], // 数组值 const uint data_array_offset, // 以字节为单位的数组值抵消 const uint data_array_count, // 要编写的数组值数 const uint flags // 定义缓冲区属性的标识组合 );
参数
buffer_index
[in] 缓冲区索引。
&data[]
[in] 将要写入OpenCL缓冲区的数组值。
data_array_offset
[in] 以字节为单位的数组值抵消,自初始值开始。
data_array_count
[in] 将编写的值数。
flags
[in] 使用标识组合设置缓冲区属性。
返回值
如果执行成功,返回true,否则 - false。