Login  Register

CLGLTexture2d.java bug and fix

Posted by GiGurra on Apr 08, 2012; 11:06am
URL: https://forum.jogamp.org/CLGLTexture2d-java-bug-and-fix-tp3894276.html

Hello,

I'm not sure if I should report this somewhere else, but. I've just begin working on a new spare time project of mine for ray tracing in OpenCL, and thought I would share a texture from OpenCL (the produced framebuffer) with OpenGL (so I don't need to download to cpu and then upload again to gpu).

The JOCL and JOGL Java wrappers are nice, however, when trying to create a shared texture with the wrapped methods I've run into a problem (works fine with the low level bindings btw).

I believe the createFromGLTexture2d method in the CLGLTexture2d class is broken.

The line (it reports error on success ^^ because you feed it with the image ref id instead of the previous return code :))
   checkForError((int)id, "can not share memory with texture #"+texture+".");
is wrong, it should be:
   checkForError(result[0], "can not share memory with texture #"+texture+".");

I havent tested the rest of the fcn, so there mgiht be more problems there.

jocl 2.0 rc5



Cheers,
//Me