Skip to main content
gamedev.net
🔒 Locked

Vertex cache

Started by ClementLuminy May 23, 2006 at 4:03 AM 3 replies 2.1k views
Original Post
ClementLuminy
ClementLuminy
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
sirob
sirob
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.
jollyjeffers
jollyjeffers
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 |
sirob
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 :).
Sirob Yes.» - status: Work-O-Rama.
jollyjeffers
jollyjeffers
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 |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.