Question

I am designing an implementation of an algorithm with Renderscript. The algorithm can be computed using OpenGL ES shaders, but the results have to be in floating point, or at least half-float. Mapping GPU memory with that type is supported in iOS, but from what I gather from reading the Android source, gralloc/GraphicBuffers in Android only support unsigned char data.

In devices with OpenGL ES 3.0 or the appropriate extensions, is it actually possible to create an Allocation with float type in texture memory, use it as a target and then read the results from it? I can use Renderscript from the NDK if necessary.

Thank you.

Was it helpful?

Solution

It depends. RenderScript supports float allocations. You can read/write them with both kernel inputs, output, and get/setElementAt.

Texture sampler support is limited to UCHAR buffers. So if you want more than point filtering you will need to build it using rsGetElementAt_float4(). (or whatever data type you choose to use).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top