Vertex cache

Started by
3 comments, last by jollyjeffers 17 years, 11 months ago
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
Advertisement
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.
Sirob Yes.» - status: Work-O-Rama.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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 :).
Sirob Yes.» - status: Work-O-Rama.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement