cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sajis997
Adept I

GL CL Interoperability

Hello forum,

In the OpenCL 1.1 spec , it is mentioned that if the GL object is modified through the GL API, while there exists a corresponding the CL buffer object , the subsequent use of the CL buffer object will result in undefined behavior. How to avoid this ?

Should we release the CL buffer and create it again using the clCreateFromGLBuffer() ?

Any more thoughts on this?

Regards

Sajjadul

0 Likes
3 Replies
nou
Exemplar

yes recreate it. because for example glTexImage2D() which is mentioned is equivalent of creating new texture. OpenGL can release and reallocate memory bound to texture so it introduce whole bunch of undefined scenarios.

moozoo
Adept III

As far as I am aware

create in OpenGL

clCreateFromGLBuffer

Do read/write stuff in openGL with it

  clEnqueueAcquireGLObjects

   read it, change it whatever in opencl

  clEnqueueReleaseGLObjects

  clFinish

Loop

Hi you can even go through OpenCL 1.2 Extension Specification Section 9.6 and 9.7. It may help you out in this

0 Likes