Regarding doing OpenGL transform feedback with CUDA

Hi all,
I have an application which does some sort of simulation and the resulting vertex modification are rerendered using transform feedback. The performance is fairly good I get approx. 1000 fps on a 1024x768 screen with about 2500 particles each modifiable in realtime by mouse interaction.
Now I want to know

  1. if it is possible to use transform feedback along side a CUDA kernel? If so how do i do the synchronization of my vbos btw the opengl device and the cuda device? Would this synchronization of vbos cause delays? Any reference on this would be appreciated.
  2. Lets say I want to try the same calculations that I m currently doing in my vertex shader with transform feedback in CUDA would i give me the same performance? Does cuda have a mechanism like transform feedback or do i need to manually handle the vbos myself. Again any reference would be appreciated.



Yes it is possible.

You have your vbo in openGL, you bind it to CUDA, peform transformations and unbind the vbo to proceed with openGL.

Maybe you could take a look at the SDK example “Simple OpenGL”. This example shows you how to bind a vbo to cuda, perform transformation and render the transformed vbo using openGL.

If the performance will be better? It is hard to say. Try it out. At least you will learn something new :D

For reference, take a look at CUDA programming guide and the chapter about openGL interoperability.

For what i know there is an overhead in mapping the vbo to cuda. Last time i used it was under CUDA 3.0.