render cl_mem(image object) to window

Hi,
clCreateFromD3D10Texture2DKHR can convert texture to cl_mem, but I want to transfer cl_mem to texture,then I can render it to window. but there is no such functions. so how could I render cl_mem(image) to window using D3D?
thank you!

I haven’t used the DX/CL integration, but if its like the GL/CL integration then you need to create your cl_mem(image) from the texture and not the other way around. I agree that this can be a bit awkward from the application’s point of view, but its not insurmountable.

The other alternative would be a host-side copy, but that would be very slow so I wouldn’t suggest it.

Thank you! I know how to convert texture to cl_mem. But I dont know how to convert cl_mem to texture. I dont want to use host memory copy. Actually the problem is that I have a cl_mem(image object), I want to display it on window, how could I do?

What I was trying to say is that you can’t … instead create a cl_mem image from a texture and use that with your kernel.

One workaround is to create a second cl_mem object from the texture and do a OpenCL buffer copy to the new cl_mem object. Then render the texture, which will now be a copy of the first cl_mem object without any transfers to host memory.