Skip to main content
GameDev.net gamedev.net
🔒 Locked

Wertex Cache Reorder

Started by Samurai Jack Feb 28, 2007 at 1:50 AM 1 replies 700+ views
Original Post
Samurai Jack
Samurai Jack
Greetings! I have done some tests with triangle strips, triangle fans, restarts, indexed vertices etc... and came to the conclusion, that nothing is as fast as vertex cache optimized indexes. OK. So DirectX has cache optimize functions, but as far as I know they go for an optimal value of cache size 16. Some NVidia cards have vertex cache of 24 or even 32! My questions: a)Is it by any possible to determine the vertex cache size? Like GetVertexCacheSize() = 24 or something like that? Perhaps in graphic device information from DirectX? b) How does the mechanism work? Since it is hardcoded in DirectX I allways have to open a graphic device to reorder. It could be done in a model converter. Since it uses the value of 16 all the time. I know it somehow weights the vertices with scores. The higher the vertex score the earlier the vertex/face index. But how does it exactly work? Feel free to post. Thank you in advance!
superpig
superpig
Quote:
Original post by Samurai Jack
a)Is it by any possible to determine the vertex cache size? Like GetVertexCacheSize() = 24 or something like that? Perhaps in graphic device information from DirectX?
Under Direct3D, you can issue a D3DQUERYTYPE_CACHE query, which (if the card supports it) will tell you whether you should optimize for strip or cache, and the cache size to use.

The alternative would be to build an offline database of cards, but that's not exactly pretty. I think that if the query isn't available then simply falling back to always using 16 as the cache size is a reasonable plan.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Topic Locked

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

Sign in to reply to this topic.