cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

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 Kudos
Reply
3 Replies
nou
Exemplar

Re: GL CL Interoperability

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

Re: GL CL Interoperability

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

himanshu_gautam
Grandmaster

Re: GL CL Interoperability

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 Kudos
Reply