I can get frames from EGLFrame by cuGraphicsResourceGetMappedEglFrame() function . And then I want to bind the TexObject by use cuTexObjectCreate function , but it did not work. I have seen the demo in the histogram with using surface like below :
// Create a surface from the luminance plane
memset(&cudaResourceDesc, 0, sizeof(cudaResourceDesc));
cudaResourceDesc.resType = CU_RESOURCE_TYPE_ARRAY;
cudaResourceDesc.res.array.hArray = cudaEGLFrame.frame.pArray;
CUsurfObject cudaSurfObj = 0;
cuResult = cuSurfObjectCreate(&cudaSurfObj, &cudaResourceDesc);
is there any demo or tutorial to tell me how to use it?
I have use cudaMemcpy2DArrayToArray() function to copy EGLframe.frame.pArray to another cuArray, and then use TexRef, it did work, but it took long time to copy data by cudaMemcpyDeviceToDevice.