[android-developers] Re: Sticky behaviour of Renderscript / Filterscript kernels

2016-07-08 Thread Alberto Marchetti
t width = (int)rsAllocationGetDimX(inp); > > int height = (int)rsAllocationGetDimY(inp); > > int index = y_ * width + x_; > > int flag = (int)step(1.0f, (float)rsGetElementAt_uchar(inp,x_,y_)); > > return (index*(1-flag) - flag); > > } > > >

[android-developers] Re: Sticky behaviour of Renderscript / Filterscript kernels

2016-07-08 Thread Alberto Marchetti
There can be a chance that, if the kernel has been written to return always a constant, modifying the contents of the kernel does not let RenderScript invalidate the cache (the code, being translated to bitcode, gets highly optimized, so a constant is always a constant and, if the code that