High level OO wrapper bug: In CLGLTexture2d.createFromGLTexture2d the checkForError call gets passed the texture id instead of the error flag from the clCreateFromGLTexture2D call: checkForError((int)id, "can not share memory with texture #"+texture+"."); Instead it should be: checkForError(result[0], "can not share memory with texture #"+texture+"."); This is a bug in the high level abstraction layer, but the low level JNI bindings work fine for sharing gl-cl textures, so you can use that instead in the meantime, but it would be great to get this high level stuff working also :). It means CLGLTexture2d.createFromGLTexture2d will always fail when it actually succeeds ;).
I would like to confirm this bug. It popped up as I was testing CLGLContext. The workaround (when you don't have the JOCL src) involves copy-pasting the method and initializing everything with reflection, which is tedious. I'll post a patch.
Created attachment 360 [details] fix for CLGLTexture2d patch This patch fixes the bug. It is an extremely easy fix. I see no reason to not apply the patch. Note that the bug is probably due to a typo. Check the clCreateFromGLTexture2D documentation if you don't believe me ;) http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateFromGLTexture2D.html
We should really look at the suggested patch.
Use result value in checkForError(..) for CLGLTexture2d.createFromGL* CLGLTexture3d.createFromGL* CLGLImage2d.createFromGL* CLGLBuffer.createFromGL* instead of returned 'id' Thank you Johan & Daniel ! Using your original patch, I went through the other CLGL[Texture*|Image2d|Buffer] classes and ensured all are handled the same. @Daniel: This has nothing to do w/ trust, but I had little resources left and I am only the 'interim' maintainer - we are looking for a new one. Again: Thank you!
To all: If the patch is erroneous .. pls reopen and send a git pull request / patch. No unit test! Thank you!