简体   繁体   English

OpenGL ES vs OpenCL vs RenderScript for Android Image Processing

[英]OpenGL ES vs OpenCL vs RenderScript for Android Image Processing

I need to build an Image processing application for Android. 我需要为Android构建一个图像处理应用程序。 Performance is the main requirement and I am looking to use gpu compute. 性能是主要要求,我希望使用gpu compute。 I want to know which of the 3 libraries is best to use. 我想知道哪3个库最好用。

I know OpenGL is primarily for graphics but also supports computer shaders. 我知道OpenGL主要用于图形,但也支持计算机着色器。

I am not sure how well supported OpenCL is on Android 我不确定OpenCL在Android上的支持程度如何

RenderScript lacks documentation and I think is slower than other libraries. RenderScript缺少文档,我认为比其他库慢。

For an Image Processing App, the heaviest part is in the processing (transforming/manipulating) the pixels of images in memory, not rendering images to screens/buffers. 对于图像处理应用程序,最重要的部分是处理(转换/操纵)内存中图像的像素,而不是将图像渲染到屏幕/缓冲区。

Sure, that kind of processing is general and needs a general-purpose computation API. 当然,这种处理是通用的,需要通用计算API。

Thus, we can eliminate OpenGL ES. 因此,我们可以消除OpenGL ES。 It supports shaders, but the OpenGL ES Shading Language is very limited and definitely not suitable for general processing. 它支持着色器,但OpenGL ES着色语言非常有限,绝对不适合一般处理。

RenderScript, according to this : RenderScript,根据这个

RenderScript does not use any GPU or DSPs cores. RenderScript不使用任何GPU或DSP内核。 That is a common misconception encouraged by Google's deliberately vague documentation. 这是Google故意模糊的文档所鼓励的常见误解。 RenderScript used to have an interface to OpenGL ES, but that has been deprecated and has never been used for much beyond animated wallpapers. RenderScript曾经有一个OpenGL ES的界面,但已被弃用,并且除了动画壁纸以外从未使用过。 RenderScript will use multiple CPU cores, if available, but I suspect RenderScript will be replaced by OpenCL. RenderScript将使用多个CPU内核(如果可用),但我怀疑RenderScript将被OpenCL取代。

I'm working for a big video game company, we don't have any plan to use RenderScript. 我在一家大型视频游戏公司工作,我们没有任何计划使用RenderScript。 We think Vulkan is a better choice. 我们认为Vulkan是更好的选择。 I suggest you choose Vulkan too but the problem is that the number of Android devices supporting Vulkan is pretty low now. 我建议你也选择Vulkan,但问题是现在支持Vulkan的Android设备数量非常少。

Therefore, to answer your question, please go with OpenCL. 因此,要回答您的问题,请使用OpenCL。 Although OpenCL is not part of the Android platform, many manufacturers provide drivers or even SDKs to support OpenCL on Android. 虽然OpenCL不是Android平台的一部分,但许多制造商提供驱动程序甚至SDK来支持Android上的OpenCL。 At least, it is better than Vulkan in terms of number of supported devices. 至少,它在支持的设备数量方面优于Vulkan。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM