Returning a Renderscript struct from a Renderscript kernel

青春壹個敷衍的年華 提交于 2019-11-29 15:58:57

RenderScript currently doesn't reflect a method to copy back the values from a user-defined struct to Java. We indeed only have methods that operate on primitive Java and vector types. The Allocation is still usable by other kernels or Script-side functions.

Actually you should use the copy1DRangeToUnchecked method of the Allocation class. You can copy it into your own ByteBuffer and deserialize it yourself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!