Hi All,
In order to avoid unnecessary stress caused by walking an unknown path, I would rather ask the community to help me answer the following question:
How to change the content of one VBO by content of the other using OpenGL API?
It is not an ordinary copying. For example, I need to create an upsampled/downsampled version of data already stored in another VBO, or something similar. I have implemented it using CUDA, but that approach has several drawbacks:
-
The registering process (cudaGraphicsGLRegisterBuffer) is a pretty lengthy operation. Application initialization time becomes unacceptably long if I register all VBOs I want to use later.
-
Whenever a transformation should occur, buffers involved in the transformation have to be mapped (cudaGraphicsMapResources + cudaGraphicsResourceGetMappedPointer). Mapping requires all pending GL calls to finish before CUDA start to use the resources.
-
Unmapping (cudaGraphicsUnmapResources) also creates a stall in a pipeline waiting CUDA to finish all pending calls.
Much of the Map/Unmap times can be hidden by smart code reorganization, but cannot be completely eliminated. Application initialization (registering) is the most irritating issue. There are also other issues, but I believe they are driver dependent, and they currently make no trouble (like different VBO memory footprints after mapping with CUDA). Having all previously mentioned in mind I would try to use only GL API to achieve similar results, and to avoid stalls imposed by CUDA/GL interoperability.
Before starting banging my head against the wall, I would like to hear your opinions and suggestions.
Thank you in advance!