0

Is it possible to go from ArrayFire to OpenGL and back using an AMD graphics card?

There is an article on how to do it using CUDA. Any hints on using a similar method for OpenCL, so it can be used cross-platform?

Update

What I would like to do in the end is take an af::array, convert it to an OpenGL texture and render it with my custom shader to the screen or to another texture (assuming a given OpenGL context, for example from Qt).

Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105
  • We have a library called forge that does this automatically. If you want specific helper functions, please create a new issue on github. – Pavan Yalamanchili Sep 22 '15 at 22:51
  • @PavanYalamanchili: Thanks for the comment. But this is only for displaying, no? See my update of the question... – Jan Rüegg Sep 23 '15 at 06:39
  • What you need is a way to tweak the Arrayfire context creation flags to include a gl share flag. After that you can get the underlying cl_buffer of any array, and pass it to your gl context and back. – DarkZeros Sep 23 '15 at 12:34
  • @JanRüegg Please make this a github issue so we can have a better discussion on this. SO is not the avenue for this discussion. – Pavan Yalamanchili Sep 23 '15 at 16:48
  • @PavanYalamanchili Ok, I'll do that, thanks! – Jan Rüegg Sep 28 '15 at 07:10

2 Answers2

0

As far as I know, the OpenGL-OpenCL interop via cl_khr_gl_sharing is not supported by the newest ArrayFire (at least for Intel graphic cards (Iris and so on)). For me it looks like the cl_khr_gl_sharing is generally not supported by ArrayFire.

Vlad
  • 39
  • 5
  • @ Pavan Yalamanchili Well, I referred to: "OpenGL-OpenCL interop via cl_khr_gl_sharing is not supported " here: [link](http://arrayfire.com/opencl-on-intel-hd-iris-graphics-on-linux/). – Vlad Oct 02 '15 at 08:39
0

This is not possible so far. There is a github issue on the official bugtracker, though.

Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105