Modify OpenGL Interop to use CopyInto function in ArrayHandle
The OpenGL Interop code copies data from an array handle into an OpenGL context. There are specialized functions for array handles of type StorageTagBasic
and DeviceAdapterCuda
. For all other array handle types no assumptions are made. Instead, the array handle is copied into an array handle of type StorageTagBasic
and using the StealArray
function a raw pointer to the data is passed to OpenGL. This, however, is slow since it requires copying the data twice before giving it to OpenGL.
An alternate solution is to use the CopyInto
function in array handles, which can copy the data directly from the execution environment into an STL compatible iterator. This avoids the copy into an array handle of type StorageTagBasic
and can improve performance.
Once the CopyInto
function has been merged in MR(#121), update the interop code to use this function.