Re the CUDA-OpenGL Interop APIs:
Needing some clarification on the relationships and mappings between CUDA objects (textures, surfaces, arrays, linear memory i.e. cudaMalloc( )) and OpenGL objects (buffers, textures, render buffers),
Specifically which OpenGL objects can map to which CUDA objects?
One at least seems clear -
OpenGL buffer (VBO) => CUDA linear memory pointer
Via cudaGraphicsGLRegisterBuffer( )
And cudaGraphicsMapResources( ) then
CudaGraphicsResourceGetMappedPointer( )
CudaGraphicsGLRegisterImage( ) -
Docs say it supports OpenGL texture or render buffer. In the case of mapping to a CUDA Surface object, is the flag = cudaGraphicsRegisterFlagsSurfaceLoadStore the only option to use?
Can an OpenGL texture be mapped to a writeable CUDA surface object?
Can an OpenGL texture or render buffer be mapped to a CUDA pointer?? (I.e. cudaGraphicResourceGetMappedPointer( cudaResourceToOpenGLTexture/Renderbuffer, …)
CudaGraphicsSubResourceGetMappedArray( ) - does it have to be passed a cuda resource registered as Image?
What is the difference between a CUDA texture, surface, and/or array?
Referring to CUDA Toolkit 12.1 docs section 3.2.14.3 : Are both textures and surfaces instances of the general (‘abstract’) CUDA array type, or is there more to it? Is the Array type ever used directly from CUDA or just as textures and/or surface?
Thanks