textures with pbo's

Hi there,
I have a question about the use of PBOs with textures. I have seen in an open source engine that they use a PBO for each texture. That means operations like update will be performed by
PBO. Is this ok ? I mean setting up and using a PBO has some overhead, right ?

regards,
lobbel

The only significant overhead is when using PBOs is to copy data from client to the server. If, the engine you’re talking about use different PBOs but they are set once, there’s no significant overhead.

I have seen in an open source engine that they use a PBO for each texture.

Do you mean that each texture has its own buffer object? Because that would be a terrible idea.

Yes,
a buffer is genereated whenever e new textures has been created.
That’s why I am asking wether this is a good idea or not.
As far as I know there is a lot of overhead with respect to buffer objects.

regards,
lobbel

As far as I know there is a lot of overhead with respect to buffer objects.

It’s not about overhead with respect to buffer objects. It’s about not doing something pointless.

Using Pixel Buffer Objects means that you’re using a buffer object as the source or destination for a pixel transfer operation. That is, you put pixel data, possibly loaded from a file, into a buffer. Then you do a glTexSubImage from that buffer object into a texture. After the pixel transfer operation completes (sometime after the glTexSubImage call returns), you have no further need for the buffer object anymore.

There is no permanent association between the buffer object and the texture object. The buffer object does not represent the content of the texture. So there’s no point in having a separate buffer object for every texture.

In general, it’s better to have a small set of PBOs around, and simply pick whichever one was least recently used.

Hello,
thanks for your answer, that makes sense.

regards,
lobbel