Hi. Nice to meet you all.
‘clCreateFromD3D9TextureNV’ function can returns an error named ‘CL_INVALID_D3D9_RESOURCE_NV’,
if the IDirect3DTexture9 instance isn’t created with D3DPOOL_DEFAULT option, or
specific miplevel is already created, or
the opencl context is different from the one created by another IDirect3DDevice9.
In my code, there’re no above cases.
I created the IDirect3DTexture9 instance with D3DPOOL_DEFAULT option,
there’s no miplevel, and there’s only one IDirect3DDevice9 / OpenCL context instance.
There are 23 cl_mem objects created by clCreateFromD3D9TextureNV when the error is occured.
And GPU memory is used about 480MB, total amount is 1GB.
IDirect3DTexture9 create option:
Using D3DXCreateTexture func
Width: 330 Height: 246
D3DUSAGE_DYNAMIC, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT
NVIDIA GeForce GTX460 1GB
OpenCL SDK 4.1 (bundled with CUDA SDK 4.1)
DirectX 9.0c (Jun 2010)
Thanks for reading!