cuda to opengl


what are the good ways to pass a large array (obtained from cuda code) to opengl shader?


What do U want to do with this data?

Just read data not write. Using texture is one way.

I also tried to set a large uniform array and copy the data to it. But it seems does not work. I dont know how uniform data are allocated (like to global memory or shared memory…).

Personally, I prefer something like cudaMemcpy way to pass the data to shader.

I don’t know what do U need - there’s big difference between using texture and uniform array.
Try to see nv tutorials - Simple OpenGL and FFT Ocean Simulation. You don’t need to copy data - just bind it.