This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hi, I created openCL context with openGLES config , and then use clCreateFromGLTexture2D function failed, do you know why ?

Hi

In android, I created cl context from gl like this :

cl_context_properties props[] = { CL_GL_CONTEXT_KHR, eglGetCurrentContext(), CL_EGL_DISPLAY_KHR, eglGetCurrentDisplay(), CL_CONTEXT_PLATFORM, clplatform,0);

clCreateContext(props,1,&device,NULL,NULL,NULL);

and then create opengl texture, this texture can be used .  After that , I want to use opencl to calculate this texture, so I do like this :

clCreateFromGLTexture2D(clContext, CL_MEM_READ_WRITE,GL_TEXTURE_2D, 0,texturename ,&errNum);

And this function failed, the errNum returned CL_INVALID_GL_OBJECT , and I do not know why , Can you help me  ?

Thanks

Parents
  • Hi kongya0712,

    After looking at the spec more closely, there are a few more things to highlight as possible causes to your problem.

    First thing to read is the extension "cl_khr_gl_sharing", you should realise that there is a limited number of supported texture formats compared to possible GLES texture formats, as in not every GLES texture can be used for CL-GLES interop.

    Secondly, there was an issue where Android itself altered the values for GL context and EGL display, which may be a problem here too. (we will need to investigate further for this one).

    I just wanted to update you on our progress, if you have made any progress yourself, please let others know.

    Kind Regards,

    Michael McGeagh

Reply
  • Hi kongya0712,

    After looking at the spec more closely, there are a few more things to highlight as possible causes to your problem.

    First thing to read is the extension "cl_khr_gl_sharing", you should realise that there is a limited number of supported texture formats compared to possible GLES texture formats, as in not every GLES texture can be used for CL-GLES interop.

    Secondly, there was an issue where Android itself altered the values for GL context and EGL display, which may be a problem here too. (we will need to investigate further for this one).

    I just wanted to update you on our progress, if you have made any progress yourself, please let others know.

    Kind Regards,

    Michael McGeagh

Children