Since all immediate mode functions and client side vertex arrays are deprecated, I wonder what is the best way to render a screen-space quad (when there could be hundreds used for font rendering).
Basically I see two ways:
- Having a VBO with 4 vertices where the vertex data (position, texcoords) is updated dynamically using glBufferData
- A single VBO with 4 vertices but the vertex data (x,y,u,v) is given to the shader as a small array of uniforms and the shader resizes the quad based on the uniform data
The first way is certainly less complex (although 2 is also easy but needs a more specialized shader) but I wonder how much GPU synchronization will be of a performance issue. The same vertex array is possibly reused a hundred times so the driver always needs to wait until the VBO is no more in use by the GPU.
There is an NVidia presentation which says that internally the driver can create a new VBO when glBufferData is used but I don’t know if this optimization is done by all vendors.