I just downloaded the CUDA 6 Toolkit and compiled the “simpleD3D9Texture” example. It works well as is.
Now, if I simply replace the Direct3D9 device by a Direct3D9Ex device, keeping all of the other code identical, I get the following error at run-time, in RunCuda():
Here are the only modifications to the code I made:
//IDirect3D *g_pD3D; // Used to create the D3DDevice IDirect3D9Ex *g_pD3D; // Used to create the D3DDevice //IDirect3DDevice9 *g_pD3DDevice; IDirect3DDevice9Ex *g_pD3DDevice; //if (NULL == (g_pD3D = Direct3DCreate9(D3D_SDK_VERSION))) if (NULL == (Direct3DCreate9Ex(D3D_SDK_VERSION, &g_pD3D))) //if (FAILED(g_pD3D->CreateDevice(g_iAdapter, D3DDEVTYPE_HAL, hWnd, // D3DCREATE_HARDWARE_VERTEXPROCESSING, // &d3dpp, &g_pD3DDevice))) if (FAILED(g_pD3D->CreateDeviceEx(g_iAdapter, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, nullptr, &g_pD3DDevice)))
Is Direct3D9Ex interop supported and if so, are there particular cuda methods that are not compatible? What causes this error?
EDIT: NVM, obvious oversight:
if (NULL == (Direct3DCreate9Ex(D3D_SDK_VERSION, &g_pD3D)))
needs to be != instead of ==. facepalm It works fine after that.