Can one use RenderScript's rsForEach on a non-root kernel?

前端 未结 1 1020
广开言路
广开言路 2021-01-19 18:59

Can one invoke a non-root RenderScript kernel using rsForEach? There are many examples of using rsForEach to call the root kernel from within an in

相关标签:
1条回答
  • 2021-01-19 19:10

    Unfortunately we don't currrently have a way to invoke a non-root RenderScript kernel using rsForEach() from the script. You will have to call into it from Java directly. You could also put the second kernel in another Script as root() and then bind that rs_script as well (e.g. you can have gScriptGradient and gScriptGray and execute them sequentially from a single invoke in your primary Script).

    I initially missed your second question about synchronization between parallel kernels. They are indeed ordered. Although kernels are launched asynchronously, the second kernel will not run until the first kernel is complete.

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