Using the same memory for both CUDA and DirectX

Hi All

The system has to run at around 50 fps, so it should not be overly costly in processing power. Here is a short description of what I’m trying to do using CUDA and directX.

  1. Allocate 2 buffers (pGpu1 and pGpu2) using cudaMalloc
  2. Load data from system memory to pGpu1
  3. Process the data, using pGpu1 as input and pGpu2 as output. The processing is defined by a normal CUDA kernel.
  4. Use the processed data available at pGpu2 as the texture for a directX10 shader resource.

As the size of the da might be changing, I would like to avoid having to create new textures all the time, and also reduce complexity. I can’t figure out if it is possible to simply set the pointer of a 2D texture to the CUDA allocated memory, define the pitch etc. and then simply use it in DX10.

Any help and hints are welcome

Cheers

Henrik