opengl-esglslopenclopengl-es-2.0

How to let a vertex shader in OpenGL ES 2.0 perform GPGPU computing?


I'm doing a project using OpenCL and thought it can work on Mali 400 GPU. But I recently found that Mali 400 GPU only support OpenGL ES 2.0 standard.

I still have to use this GPU, So is there any way to let a shader act nearly the same as OpenCL kernel or CUDA kernel?

There are some main features I expect but not sure glsl will support:


Solution

  • So is there any way to let a vertex shader act nearly the same as OpenCL kernel or CUDA kernel?

    No.

    In ES 2.0, vertex shaders have no mechanism to write to memory. At all. All of their output variables go to the rasterizer to generate fragments to be processed by the fragment shader.

    The only way to do GPGPU processing on such hardware is to use the fragment shader to write data. That means you have to manipulate your data to look like a rendering operation. Your vertex positions needs to set up your fragment shader to be able to write values to the appropriate places. And your fragment shader needs to be able to acquire whatever information it needs based on what the VS provides (which is at a per-vertex granularity and interpolated for each fragment).