Sign in to follow this  

Vertex cache

This topic is 4225 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

Hello. I have recently read a few papers about Vertex Caching. It seam to be a quiet easy way to get some performances gain. Here is what i have understand : Suppose you've got an index buffer describing four faces: 0,1,2, 3,4,5, 2,1,4, 1,3,4 (And also suppose that my vertex cache is a 3 Vertex Cache) The only thing needed to use Vertex Cache is to sort the IB this way: 0,1,2, 2,1,4, 1,3,4, 3,4,5 I'm i right ?? Do i need to do any other things ?? Do you know a little library which sort any IB in order to be used with Vertex Chache ?? Thanks a lot .. Clément Vidal

Share this post


Link to post
Share on other sites
The Vertex Cache is on whenever you draw Indexed Primitives. You don't need to enable it or do anything else.

The process you describe would only increase it's effectiveness, not turn it on.

As for a way to get better Cache results, ID3DXMesh has an optimize method that can take a flag to perform Vertex Cache optimizations, which is esentially what you're looking for. You should probably be able to run any mesh you have through that once to get better Cache hits.

Hope this helps.

Share this post


Link to post
Share on other sites
Yeah, it is pretty much as simple as you said [smile]

I recently put together a vertex cache demo. Read the main article and the follow up for details. The second part has updated code with full examples.

Bare in mind that the cache size changes between different GPU's. Nvidia's earlier chips were 16 elements, the more recent being 24 elements. ATI's appear to be 14 elements - but I dont have any solid evidence for that (damn ATI for not supporting VCache queries [flaming]).

Quote:
Original post by ClementLuminy
Do you know a little library which sort any IB in order to be used with Vertex Chache ??
As sirob suggested, you've got the Optimize methods for ID3DXMesh... but you've also got D3DXOptimizeFaces() and D3DXOptimizeVertices() for non-mesh geometry.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
As sirob suggested, you've got the Optimize methods for ID3DXMesh... but you've also got D3DXOptimizeFaces() and D3DXOptimizeVertices() for non-mesh geometry.

Oh, that's new to me :).

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
Quote:
Original post by jollyjeffers
As sirob suggested, you've got the Optimize methods for ID3DXMesh... but you've also got D3DXOptimizeFaces() and D3DXOptimizeVertices() for non-mesh geometry.

Oh, that's new to me :).
The aforementioned article and code has a version that uses these two functions (contributed by Eyal 'ET3D' Teler).

The re-ordering required is fairly unintuitive though, so they're not the simplest functions to work with....

Jack

Share this post


Link to post
Share on other sites

This topic is 4225 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this