Monday, April 19, 2021

Android 12 deprecates the RenderScript API for GPU compute tasks

Google introduced the RenderScript API all the way back in Android 3.0 Honeycomb for applications that need to run high-performance workloads on the CPU or GPU without using NDK or GPU-specific APIs. With improvements to NDK tooling, GPU compute using OpenCL, the introduction of the Vulkan API, and the capability to share Bitmap hardware buffers between Android SDK and NDK code, Google has decided to deprecate the RenderScript APIs in Android 12.

As explained on the Android Developers Blog, Google no longer recommends RenderScript for performance-critical tasks. Instead, high-performance workloads that need to run on GPU hardware should migrate to the cross-platform Vulkan API. Google has provided a sample app that demonstrates two RenderScript scripts with their Vulkan equivalents. If your app needs to work on older devices, you may need to manage two code paths: one with RS for older devices and one with Vulkan for newer devices.

For apps that used RS for its set of high-performance image manipulation functions such as blur, Google has provided an Android library that replaces most of the deprecated Intrinsics functions. While the APIs will continue to function on Android 12, Google says compiling RS code when targeting the release will throw a warning.

The post Android 12 deprecates the RenderScript API for GPU compute tasks appeared first on xda-developers.



from xda-developers https://ift.tt/32rdw6D
via IFTTT

No comments:

Post a Comment