I could previously fill textures in CUDA for use in OpenGL:
- Create and initialize a GL texture (
gl::GenTextures()etc.) - Create GL pixel buffer object
- Register PBO with CUDA
In the update / render loop:
cudaGraphicsMapResource() with PBO- Run kernel to update PBO
cudaGraphicsUnmapResource() PBO of CUDA- Download the GL program, snap the texture, render as usual.
- Repeated washing, repeated rinsing.
However, I wonder if PBO is still the best way to write texture from the kernel. I saw articles like this one ( updated for v5 here ) that don't use PBO at all.
I saw some links to cudaTextureObjectand cudaSurfaceObject, but their roll in the OpenGL interface is unclear to me.
PBO - ? , , ?
( Kepler .)