简体   繁体   中英

is there some method that like clCreateSubBuffer in Metal?

I am developing a iOS app and trying to use Metal to accelerate the computing speed.
I hope to compute data in different MTLBuffer and output into different segment of the same dest MTLBuffer. I know that in OpenCL i can use clCreateSubBuffer to access different parts of a buffer with different offsets. but i can not find such a method in Metal.
Any solution? or i just miss something?

只需将MTLBuffer绑定到具有不同偏移量的MTLComputeCommandEncoder即可:

encoder.setBuffer(myBuffer, offset: XXX, index: 0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM