2 Replies Latest reply on Jun 26, 2013 12:33 AM by himanshu.gautam

    Way to get CL context for GL context?

    bubu

      Hi,

       

      I want to perform tiled lighting for an OpenGL engine.

      I have a restriction: must run in openGL 3.2 hardware, so I can't use OpenGL 4.3 compute shaders..... so the alternative is to use OpenCL.

       

      The question is... given a OpenGL context, how can I get its associated CL context?

      And pls, notice more than ONE GPUs can be installed in the system , so I need the associated context, not a shared one . For instance:

       

      Imagine the user has a Intel Haswell IGP GPU and a Radeon 7770.

      My engine gonna select the Radeon 7770 as main engine's render card. Now I render a frame and I get the ZBuffer to perform tiled lighting.

      Now I'll fire a CL kernel to get the min/max Z per tile... BUT... obviously, I don't want this ZBuffer to be passed into the Haswell GPU or this will be terribly slow !

      I need to stay in the Radeon 7770... So I must be sure the CL context corresponds to the GL context hardware!

       

      So...given a OpenGL context, how can I get its associated CL context? And multiplaform solution ( linux,. mac, windows ), pls

      thx