In this chapter we will discuss OpenCL and OpenGL interoperation, which in its simple form means sharing of data between OpenGL and OpenCL in a program that uses both. Interoperation is commonly abbreviated as interop.
OpenGL was first released in January 1992 for proving graphics acceleration APIs. OpenCL was first released in December 2008 for accelerating general purpose computing. Both OpenCL and OpenGL use a GPU for their acceleration (OpenCL can use many other devices though). This OpenCL-GL Interoperation feature was introduced from the earliest version of OpenCL, that is, 1.0, but was really improved in OpenCL 1.1 by linking OpenCL and OpenGL events and efficient sharing of image and buffers. The computational part is done by OpenCL and graphics rendering is done by OpenGL without transferring data to and from host. This optimization in memory bandwidth should lead to an increase in efficiency and simplicity in coding.
In this chapter we first...