Android documentation Renderscript extended rsForEach call

I have a question about how the Androids Renderscript rsForEach function works with the rs_script_call_t * argument. In the examples, only another (simple) rsForEach function is used, so this does not help me. I would like to change xStart and xEnd of my array and experiment with different RS_FOR_EACH_STRATEGY. I understand that I have to build the rs_script_call_t structure and set the fields for the correct values. However, any attempt to use this rsForEach call results in the creation of SIGSEGV and coredump.

In the rs_script_call structure (in rs_math.rsh):

  • What are the values ​​of xStart, xEnd, yStart, yEnd, zStart, zEnd referring to? Indexes or pointers?
  • What are the values ​​of arrayStart and arrayEnd? Indexes or pointers?
  • What are the default values ​​for them?

Is there any other documentation (or examples) that explains how to properly use the rsForEach function with the rs_script_call_t * argument?

+4
source share
1 answer

The x / y / z / start / end values ​​are the memory allocation indices that the script calculation is working on. The structure may restrict the rsForEach call to the distribution subregion.

For example, to highlight 640x480, you can define xStart = 100; xEnd = 200; yStart = 100; yEnd = 200. Then the foreach call will be launched in the distribution area 100x100.

ArrayStart and arrayEnd are not currently used right now, but are defined for a future version that will support array sizes in distributions.

The default values ​​are undefined, you need to define your own values ​​in the structure. If you are not using a structure, the rsForEach call will work in the entire memory allocation.

There is a known bug that crashes when using this in Honeycomb, so this may be your problem. It has been fixed in ICS.

+1
source

Source: https://habr.com/ru/post/1368965/


All Articles