OpenCL Image Support

>> Monday, June 20, 2011

The GPUs that I use for testing all support OpenCL image objects, but not to the fullest extent of the specification. For example, I can't get linear interpolation to work and many of the image format types don't seem to be readable by the kernel.

My latest concern has been with OpenGL-OpenCL interoperability. I've had no trouble creating buffer objects with clCreateFromGLBuffer, but when I try to create image objects with clCreateFromGLTexture2D, I always get the CL_INVALID_IMAGE_FORMAT_DESCRIPTOR error. This happens no matter what image format I choose.

I spent a lot of time on this, but then I looked through the sample code in the AMD SDK. Instead of calling clCreateFromGLTexture2D, their application stores texture data using pixel buffer objects (PBOs). Very clever. PBO data can be shared with OpenCL buffer objects in the same way that VBO data can, and once the PBO is bound to the GL_PIXEL_UNPACK_BUFFER target, texture objects can read their image data from the PBO.

I'm glad there's a workaround for the clCreateFromGLTexture2D issue, but I'd be even happier if the function worked properly.

0 comments:

Post a Comment

  © Blogger template Werd by Ourblogtemplates.com 2009

Back to TOP