When does the DMA happen with PBOs?

I’m using PBOs to upload some texture data from system memory to the GPU. PBOs allow data to be uploaded via DMA asynchronously but when does the DMA start? Does it start right after a call to glBufferData/glBufferSubData or do I need to make a call to glBufferData/glBufferSubData followed by a call like glDrawPixels or glTexImage* to start the DMA?

My program has extra work that needs to be done so should I do it between glBufferData and glTexImage or after glBufferData and glTexImage for optimal performance?

OpenGL standard does not tell you this.

My experience (NVIDIA) is that the transfer happens when you call glTexImage.

I’d like to advise you to not call glBufferData with valid data pointer. It does CPU memory copy inside. Call it with NULL data pointer and map/unmap the memory and fill the memory in another thread. This way you get the best performance.

If we don’t know what causes the DMA to start then how can anyone implement the 2 PBO streaming texture example as described here: http://www.songho.ca/opengl/gl_pbo.html ?

If we don’t know what causes the DMA to start then how can anyone implement the 2 PBO streaming texture example as described here: http://www.songho.ca/opengl/gl_pbo.html ?

I don’t see anything on that page that requires you to know when the DMA starts.