My platform is Windows PC and C++. I am using an image buffer in GPU video memory via CUDA. Is there any way to directly send the content to GPU for display? Currently, I am getting the content into system memory and then use API function (such as GDI, OpenGL. DirectX) to send it back to GPU for display. I wonder if there is a faster way to do this.
You can bind a CUDA array as a texture, and then use that texture for rendering. There are restrictions on valid texture formats, and limits imposed on CUDA arrays to make this all work, but it does.
The specific API call in CUDA varies by which graphic API you're using, but look for "register resource."
Basically, create the texture with the appropriate image data like you wanted to render it (say, with D3D's
Do the same for your render buffer (output texture, FBO bound in GL or
A not-great but not-terrible article with OpenGL integration with CUDA is on 3dgep.com.
Maybe this might not be of use to you, but Direct Compute will let you create a UAV (which can be used to calculate stuff onto, aswell as render to the display.
Direct Compute is staright forward and isent much of hassle to implement. i have used this myself when doing GPGPU stuff.