Hawk89
Hawk89

Reputation: 233

OpenCl 2: How to convert image2d object to buffer without copy and vice versa

Does anyone know how to convert a given image2d object into buffer, and from buffer to image2d object?

I know that in opencl 1.2 there was an extension called cl_khr_image2d_from_buffer, and that in opencl 2 it became core functionality.

Upvotes: 3

Views: 924

Answers (1)

Dithermaster
Dithermaster

Reputation: 6343

Use cl_khr_image2d_from_buffer when you can, otherwise write a kernel that copies the data from image to buffer or buffer to image. The memory layout of an image is private to the implementation and should be considered unknown.

Upvotes: 1

Related Questions