PDA

View Full Version : Buffer object sizing and performance in GL32



M/\dm/\n
11-19-2009, 10:02 PM
I'm still designing my new engine and the question that bugs me is vertex attribute storage.

Since the engine will be based on GL32 FW_COMPAT, I have to store all data in buffer objects. But since I haven't tried to do serious rendering for some time I don't know what are the pitfalls of these objects.

From http://developer.amd.com/media/gpu_assets/PerformanceTuning.pdf presentation I understand that big BO are bad, but small BO are also bad, unfortunately I can't find any research on optimal sizing.

Since you have worked with BO more then I, can you tell me what modularity I should try to achieve?

So far I understand I should go for indexed buffers, preferably with drawrangeelements. But optimal vertex count and state change costs are still quite fuzzy for me.

Do you pack all objects in one big buffer at level load and then draw them via drawrangeelements or is it smarter to create a buffer for each object and then rebind the buffers?

What about objects that have variable vertex attribute count, some have color information, some don't? Should I create two interleaved buffers or pad the missing vertex attributes?

Alfonse Reinheart
11-20-2009, 01:39 AM
From http://developer.amd.com/media/gpu_assets/PerformanceTuning.pdf presentation I understand that big BO are bad, but small BO are also bad, unfortunately I can't find any research on optimal sizing.

So, what performance problems are you having that you think that your buffer object size may be a problem? Or are you trying to optimize before you've actually run into a performance issue?

M/\dm/\n
11-20-2009, 05:00 AM
I'm trying to sketch the architecture for the engine, therefore I'm outlining possible areas that could make problems later.

All the ideas I have so far depend on a buffer storage quite a lot. So that if I do something wrong buffer size wise, most likely I will have to do a rewrite. Trying to avoid that by listening to what wiser people say :)