Hi I have coded some example trying to see how d3d interop works..
I see up to three APIs one is
KB91 - Additional Header File Required For Preview Feature: ATI Stream SDK v2.01 Support for OpenCL™ / Microsoft® DirectX® 9 & 10 Interoperability
wich shows in cl_amd.hpp clEnqueueReleaseExternalObjects similar to clEnqueueReleaseGLObjects for gl interop..
this seems to be the correct way according to KB but I can't find clEnqueueReleaseExternalObjects with clGetExtensionFunctionAddress so I also
in cl_d3d9.h I see
clEnqueueAcquireD3D9ObjectsKHR which is another way..
this is found by clGetExtensionFunctionAddress
then for buffer interop similarly we found two functions:
and then below is
// Legacy AMD CL-D3D9 interop extension
With clGetExtensionFunctionAddress I found clCreateFromD3D9BufferKHR which is the correct I think.
also I'm asking for correct texture interop(yeah I know is image support required but I'm talking having correct/stable source code here not testing)
I must use this clCreateFromD3D9TextureKHR?
For testing I create context with
cl_context_properties cps =
with a D3d device created and then use
CL_API_ENTRY cl_mem (CL_API_CALL
cl_context /* context */,
cl_mem_flags /* flags */,
IDirect3DTexture9 * /* texture */,
HANDLE /* shared_handle */,
UINT /* miplevel */,
cl_int * /* errcode_ret */);
as clCreateFromD3D9TextureKHR is defined already in header.
where g_inputTex is created and g_handle is the last parameter returned by CreateTexture. Is this correct?
In this way I get runtime error after enabling images with "set GPU_IMAGES_SUPPORT=1"
setting the Handle shader parameter to NULL
returns an CL_INVALID_D3D_OBJECT
What's the correct API? Is that stable?
Is there any sample showing interop?
is d3d11 interop coming? as nvidia has one d3d11 extension published in khronos registry?..