OpenCL - OpenGL data sharing (beginner) Sharing (read/write) of VBO to openCL and OpenCL basic quest

First post here, so hello everyone : )

Decided to learn some OpenCL for fun, so as a beginner(newb) I have some questions which hopefully someone can answer. I’ve already written some basic OpenCL programs, but now am interest in sharing data with OpenGL.

I have this program which draws many points using VBO (vertex,color). I would like to operate on that vertex & color data in OpenCL, but I lack enough of an understand of OpenCL to get it working. I have added what I think are all the pieces, but no go. I am currently using NVIDIA oclSimpleGL example (latest version as of this post) and OpenCL spec 1.1 document as reference.

1.

First off I would like to existing data structure for VBO, which is struct of vertex, color, like this

struct vertex_info

{

float x, y, z;

float r, g, b, a;

}

Is it possible to use this arrangement with OpenCL, or do I have to split it up to VBO for each, 1 for vertex, another for color

2.

oclSimpleGL seems to just fill in data, rather than modifying data filled in host, is there better example for what I am doing to reference?

3.

Do I need to declare in kernel the same structure used for VBO(in openCL types) and use that as type?

4.

Is there easy way of debugging kernel, rather than writing stuff to variable and doing readbuffer in host to see if any changes?

I just started recently so some might be pretty basic questions, but I would appreciate help for any of these. Thanks.

Was able to get everything working : ) I’m justing sending vertex info now, not color.

Just doing some data transformations in kernel to data sent to VBO, pretty simple stuff, now to move on.

Still need to try 1, for having single structure for color/vertices