Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the overhead of constantly uploading new Textures to the GPU in OpenGL?

What is the overhead of continually uploading textures to the GPU (and replacing old ones). I'm working on a new cross-platform 3D windowing system that uses OpenGL, and am planning on uploading a single Bitmap for each window (containing the UI elements). That Bitmap would be updated in sync with the GPU (using the VSync). I was wondering if this is a good idea, or if constantly writing bitmaps would incur too much of a performance overhead. Thanks!

like image 691
bbosak Avatar asked Mar 02 '11 23:03

bbosak


1 Answers

Well something like nVidia's Geforce 460M has 60GB/sec bandwidth on local memory.

PCI express 2.0 x16 can manage 8GB/sec.

As such if you are trying to transfer too many textures over the PCIe bus you can expect to come up against memory bandwidth problems. It gives you about 136 meg per frame at 60Hz. Uncompressed 24-bit 1920x1080 is roughly 6 meg. So, suffice to say you could upload a fair few frames of video per frame on a 16x graphics card.

Sure its not as simple as that. There is PCIe overhead of around 20%. All draw commands must be uploaded over that link too.

In general though you should be fine providing you don't over do it. Bear in mind that it would be sensible to upload a texture in one frame that you aren't expecting to use until the next (or even later). This way you don't create a bottleneck where the rendering is halted waiting for a PCIe upload to complete.

like image 190
Goz Avatar answered Nov 15 '22 14:11

Goz