Is there a concise demo available showing how to do some calculations that generate a 2D array of pixel values with OpenCL, then shows how to use that image as a texture in OpenGL (say, mapping it onto a spinning cube or something like that)?
look into SimpleGL example from APP SDK. it use buffer for VBO but it is almost the same as texture. just change buffer function into image equvivalents.
>just change buffer function into image equvivalents.
Heh....that's what I don't know how to do 🙂
you replace clCreateFromGLBuffer() with clCreateFromTexture2D(context, flags, GL_TEXTURE_2D, 0, gl_texture, &err);
only diference is specify texture_target and mipmap level. you just pass GL_TEXTURE_2D and mipmap 0.
also in kernel you treat it as image2d_t