2

I am trying to implement a custom algorithm that takes a series of pixels at a specified radius around a given point. Because I want to potentially run this algorithm over every single pixel in a 1080p image, I thought that parallelising with the GPU would be a good option.

The issue is that I need to have it running on iOS. I came across a useful iOS library called GPUImage2 that allows for a bunch of predefined functionality, but I've now hit a road block.

As far as I can tell, I cannot use compute shaders with iOS? Is my only option to switch to using Metal? I understand that android has support for ES 3.1, but their is no such option for iOS?

I guess my other question is; is using a compute shader even the right option here? My idea was to split the series of points into thread groups and then have each thread iterate through the radius points and perform the computation, allowing me to compute all of the combined radii values simultaneously. Does that seem like a valid idea, or is there a better way (perhaps one that doesn't require compute shaders)?

1 Answer 1

1

"Because I want to potentially run this algorithm over every single pixel in a 1080p image"

That means you will be fine using a fragment shader, which runs on every iOS devices. I don't know your experience in OpenGL, but one way to start learning how to run something similar on iOS would be to implement a Gaussian Blur example.

2
  • This is indeed similar to what I am trying to achieve, however I need to return several data points per pixel. Is this possible without using something like a SSBO?
    – marcel
    Commented Jan 16, 2017 at 14:28
  • It all depends on what you are trying to achieve. If "Runnning several data points per pixel" means running the same algorithm, you can just run the fragment shader multiple times. If you want to run it on specific areas, you can also crop your image and render it to a different FBO. And then later adding everything together to the final image.
    – andras
    Commented Jan 16, 2017 at 19:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.