Hi!
It’s time now for me to explore CL/GL Interop, so i started looking at the oclPostprocessGL example coming with the sdk.
as far as i understand , what happen is:
- 2 PBOs are created
- the teapot is rendered
- the image is read into a pbo with glReadPixels
- the PBOs are “registered” to CL, data is processed, then the PBOs are unregistered
- data is copied (glTexSubImage2D) from second pbo to a texture
- the texture is displayed
My question is: isnt it possible to eliminate the steps 3 and 5? i mean, isnt it possible to use an opencl buffer directly as a texture?
For example, couldnt it be possible to
- use a FBO to render into a texture
- register the texture as an opencl buffer or something
- register the second (output) buffer as a second opengl texture
- display it
?
in this way we would skip memory copy operation i think. Or i misunderstood, and these operations are not really being performed, as the PBO implementation
make so that there is no copy?
In general it would also be nice to use a cl_mem object in opengl either as a texture or as a vertex array, for example (VBO) without having to copy any memory.
Is it possible at the moment?
thanks in advance!