• Advertisement
Sign in to follow this  

Cascading vertex/index buffers

This topic is 3911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear all, I was wondering if there is any noticeable benefit in cascading several smaller vertex/index buffers into a bigger one. All vertex/index buffers should supposedly have the same layout. It's obvious that a CPU-bound application would gain some speed up if those vertex buffers can perfectly form a batch. That is: 1) All those vertex buffers are to use the same shader AND 2) All those vertex buffers are to use the exact same value for every uniform parameter defined within that specific shader. Or else the batch would break up since some shader or uniform parameter must be changed somewhere in between the drawing calls. There are ways to alleviate this problem to some degree (texture atlases, using vertex shader registers to index into modeling matrices, ...), but that's not the main concern here. So my question basically is if there is any noticeable benefit in grouping a bunch of vertex buffers together that can't form a batch? Besides avoiding memory fragmentations (which the DirectX runtime should be able to handle?! not sure) would this lead to any speed up? What's your opinion on that? Thanks

Share this post


Link to post
Share on other sites
Advertisement
I've tried this on older hardware and, unless you can also reduce the draw calls then the improved performance wasn't really noticeable. Yes, it can be a bit quicker (presumably due to better caching or some other low-level GPU architectural detail) but the real win is in converting 10 draw calls to 1 (for example).

Having said that, it shouldn't be hard to implement this strategy in your code and test it. Ultimately any "is this faster" question with such a complicated system as CPU's and GPU's is impossible to answer theoretically. There are so many variables and so many combinations that only cold, hard real-world data will tell you what you want [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Generally the less state changes the better, so yes it's a good idea to merge them together if possible. You may also save some memory into the bargain. Measurable performance increase is highly dependent on your app though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement