afaik thats right. you cannot share a texture properly yet. works ok with buffertype stuff like PBO's and map unmap buffer but thats not realy helping yet.
anyway. you can create an opencl image from a gl texture but you cannot (probably) write or read it ... still, I managed to create such texture and at least read out the order, format and dimensions correctly.
one thing that would be realy helpful with lwjgl is a bit support with opencl context creation. the way I did it atm is something like this:
cl_context = clCreateContextFromType ( contextProperties, CL_DEVICE_TYPE_GPU, null, null, null );
where the properties are :
[... setup platforms ...]
cl_context_properties contextProperties = new cl_context_properties ();
contextProperties.addProperty ( CL_CONTEXT_PLATFORM, platforms [ 0 ] );
but then :
Class< org.lwjgl.opengl.Display > display = org.lwjgl.opengl.Display.class;
Field display_impl = display.getDeclaredField ( "display_impl" );
Field ctx = display.getDeclaredField ( "context" );
display_impl.setAccessible ( true );
ctx.setAccessible ( true );
Method getHdc = display_impl.get ( display ).getClass ().getDeclaredMethod ( "getHdc" );
Method getHandle = ctx.get ( display ).getClass ().getDeclaredMethod ( "getHandle" );
getHdc.setAccessible ( true );
getHandle.setAccessible ( true );
long getHdcValue = ( Long ) getHdc.invoke ( display_impl.get ( display ));
ByteBuffer glHandle = ( ByteBuffer ) getHandle.invoke ( ctx.get ( display ));
glHandle.rewind ();
contextProperties.addProperty ( CL_GL_CONTEXT_KHR, glHandle.getInt ( 0 ));
contextProperties.addProperty ( CL_WGL_HDC_KHR, getHdcValue );
works for windows and JOCL. clCreateFromGLTexture2D does not return with CL_INVALID_CONTEXT anymore.
very ugly, you may see my point