Does uploading directly before render impact performance negatively?

I have a vertex buffer that I update once a frame using glMapBufferRange and memcpy. Directly after updating, I call glDrawArrays.

A colleague of me says that it would be better to map/write/unmap the buffer at the beginning of the frame, then do other stuff in order to give the buffer time to upload, then call glDrawArrays as late as possible.

Is this claim true? I would think that anything that can cause a flush could trigger the upload burden, maybe at an even more inconvenient time than the actual render call.

Hi,

I think your CPU performance might be negatively affected as glDrawArrays would wait for the upload to complete. Map also needs to wait for the buffer to be available. Ghosting may also occur.
Since rendering is pipelined (eg. actual rendering happens later) you might get away with both cases, but I’d check CPU performance to see which is worse.

bests,
Marton

Hello,

according to gdb the PowerVR driver sets off its ioctl calls within the thread that calls the OpenGL functions. Would it actually be able to trigger the upload in an asynchronous fashion?