I come from a long history of DX coding, with bits of OGL here and there. I’m resurrecting a large chunk of older GL code and have a few quick questions regarding filling textures via PBOs.
If I have a texture that’s intended to be static draw, i.e. I want to create it, fill it once with data off the disk, and then use it for repeat rendering, is it necessary to retain a PBO for that texture? Or can I create a PBO, map it, write to it, unmap it, call glTextSubImage2D (to have it source the pixels from said PBO), and then discard the PBO?
Furthermore, assuming I fill a texture one mip at a time, the PBO really only needs to as large as the largest mip?
Am I out in left field here? What’s the general practice when it comes to PBOs and textures? Is there generally a one-to-one correspondence, i.e. one PBO for every one texture regardless of the intended usage of the texture, or can it be done the way I’ve described (for static textures only)?
Essentially, does creating a PBO set aside memory in addition to glTexImage2D? Or is the PBO just a conduit for accessing the memory allocated by glTexImage2D?