문제

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.

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top