clCreateFromGLBuffer from OpenGL array buffer

Discussion created by jstier on Apr 7, 2011
Latest reply on May 4, 2011 by nou
error when creating a clBuffer from an GL_ARRAY_BUFFER


It does not seem to be possible to create a clBuffer from an OpenGL array buffer like so:

glGenBuffers(1, &mGLBuffer);


glBindBuffer(GL_ARRAY_BUFFER, mGLBuffer);

glBufferData(GL_ARRAY_BUFFER, 128*128*sizeof(cl_float4), NULL, GL_DYNAMIC_DRAW);


glBindBuffer(GL_ARRAY_BUFFER, 0);



mCLBuffer = clCreateFromGLBuffer(sContextCL, CL_MEM_READ_WRITE, mGLBuffer, &sStatusCL);


The call from clCreateFromGLBuffer returns an error of CL_INVALID_GL_OBJECT. I am not sure if this is supposed to be possible according to the specs, it does however work with the NVIDIA driver. Am I missing something ? I am not sure, but I would bet this worked in a previous driver version ... but I am not 100% sure

I am running the latest XP driver with a HD 5830.