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?
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.
As far as I am aware
create in OpenGL
Do read/write stuff in openGL with it
read it, change it whatever in opencl