Returning a Renderscript struct from a Renderscript kernel

前端 未结 2 371
南方客
南方客 2020-12-21 07:39

I\'m looking to return an array of struct from my renderscript kernel. My problem is that although I can create an array of the struct in java using the generated code and p

相关标签:
2条回答
  • 2020-12-21 08:15

    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.

    0 讨论(0)
  • 2020-12-21 08:19

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

    0 讨论(0)
提交回复
热议问题