2

I tried to make the source example from [1], because I want to exchange data from Java to Renderscript and vice versa using the data type "integer". Everything in this example is working fine, but I cannot get the data back from RenderScript to Java. I can see the calculated value in the Debug output but using return mScript.get_numberC(); will return 0. I was also trying [2], but that won't work too. So is there any possibility to receive data from RenderScript, without using Allocation? Another question would be how I can pass with Allocations 2 Integer Arrays over to RenderScript and to get one calculated array back without using rsPackColorTo8888(mono)? Because my application won't be graphics relevant.

[1] How to pass array values to and from Android RenderScript using Allocations

[2] How to exchange data between renderscript and android framework?

Community
  • 1
  • 1
Irgendw Pointer
  • 1,770
  • 3
  • 30
  • 67

1 Answers1

6

This is actually expected behavior in API 17; you can only receive the last value set by Java. In order to pass computed values back to Java, you have to encapsulate them in an Allocation.

We're looking at changing this in an upcoming release (in the sense that I have it mostly done right now :) ).

Tim Murray
  • 2,205
  • 13
  • 13
  • Thanks for the answer! How can put my calculated data back in an allocation and can use allocations with an integer array, respectively? – Irgendw Pointer Apr 12 '13 at 08:42