Graphics API features that it is difficult to see what is behind the scenes from the name, so there are a lot of twists and turns between it and best pratice. Yesterday I checked the buffer transfer and update Methods in OpenGL and found something I didn't notice before.
After creating a buffer object, you can transmit data from the CPU memory to the GPU memory through glbufferdata/glbuffersubdata. First, the data will be transferred to a page-locked memory by memcpy, this memory area can be directly accessed by the GPU. So far, glbufferdata will be directly returned, and subsequent data will be transmitted asynchronously from page-locked memory to GPU mempry.
The better way to update data is to use glmapbuffer/glunmapbuffer. glmapbuffer directly allocates space in page-locked memory and returns a pointer. By writing page-locked memory directly, memcpy is avoided once. Some Extensions support alignment of addresses so that SSE commands can be executed in their memory space.
I don't know if there is any inaccuracy. I will record it for now and test it with time.
Buffer transmission and update in OpenGL