Question: How do I take a GLXContext and pass it to clCreateContextFromType?
Info:
I’m learning how the openGL CL interop works. I’ve managed learn how openCL works and how openGl works, now I’m on the final step of making them work together. I was using glut, but have since started using GLX because I need a GL context for CL to be able to create its context from. I have my GLXContext saved as a global variable and I pass it to to clCreateContextFromType and i get this when I compile:
error: invalid conversion from ‘GLXContext {aka __GLXcontextRec*}’ to ‘cl_context_properties {aka long int}’
So i ran around the internet, found some advise from this blog, and made a cl_context_properties list which contained {CL_GLX_DISPLAY_KHR, glc}. It threw the exact same error. What am I missing here? there obviously something that needs to happen in order to make this GLX context suitable for openCL to take. What am I missing?
I figured it out:
Why it works I don’t really know. But I found it here.