Jump to content

OpenCL: Difference between revisions

84 bytes removed ,  14 December 2020
Line 271: Line 271:


In C++, you can use [https://github.khronos.org/OpenCL-CLHPP/classcl_1_1_image_g_l.html <code>cl::ImageGL</code>] to access textures in OpenGL.   
In C++, you can use [https://github.khronos.org/OpenCL-CLHPP/classcl_1_1_image_g_l.html <code>cl::ImageGL</code>] to access textures in OpenGL.   
Note that <code>cl::Image</code> and <code>cl::Buffer</code> are not the same thing. A buffer is a contiguous section of memory whereas an image is a mipmapped texture. Interchanging them will result in <code>CL_INVALID_MEM_OBJECT</code> errors or similar.
Note that <code>cl::Image</code> and <code>cl::Buffer</code> are not the same thing. Interchanging them will result in <code>CL_INVALID_MEM_OBJECT</code> errors or similar.
I recommend writing to a separate buffer and copying to images.
I recommend writing to a separate buffer and copying to images.