Original Post

fa_Q
May 4, 2003 at 3:58 AM
Hi may i know if a vertex cache is something i have to implement myself to batch polys or is it something that is in directx/hardware etc..?

Bennettovia
May 4, 2003 at 5:10 AM
[edited by - Bennettovia on May 4, 2003 1:34:53 PM]

Yann L
May 4, 2003 at 8:51 AM
The term cache simply refers to a memory structure used to temporarily store elements for faster access, making use of time coherency. It has absolutely nothing to do with the proximity to the CPU/GPU. You often have near caches (eg. the x86 L1 cache), but you can as well have network caches, disk caches, etc.

A vertex cache is a somewhat ambiguous term. What is commonly referred to as vertex cache, is a small data area in the GPU, that is used to cache the last 10 to 30 transformed vertices. This speeds up rendering, since primitives sharing the same vertex don’t need to transform it more than once, if (and only if) the vertex happens to be in the cache at the time the primitive indexes it.

Now, you actively have to make use of that cache. It will only be activated if you are using indexed primitives (indexed triangle lists or tristrips). Furthermore, you need to somehow organize your geometry in a cache-friendly way: indices to shared vertices should follow closely in the mesh, otherwise the transformed vertex will be pushed out of the cache before it is being used again. Both NVidia and ATI have appropriate cache optimization tools available.

A different definition of vertex cache is a data structure in VRAM or AGP RAM, that can hold whole geometry batches for faster access. This kind of structure is not directly supported by an API, so you’ll have to code it yourself. For simple 3D, it’s not important, but it’s crucial for high performance with complex geometry.

fa_Q
May 4, 2003 at 9:37 AM
Thanks for the answer.

sevecol
May 4, 2003 at 9:20 PM
There are two kinds of vertex cache.

One is the pre-T&L vertex cache, it is just a normal memory cache.

The other is the post-T&L vertex cache. The post-T&L vertex cache is used FIFO.

freshya
Aug 25, 2003 at 2:23 AM
Apologies in advance for playing necromancer with an old thread, but...

quote:


A different definition of vertex cache is a data structure in VRAM or AGP RAM, that can hold whole geometry batches for faster access. This kind of structure is not directly supported by an API, so you’ll have to code it yourself.


Show more

  • What does the V stand for in this instance of "VRAM"?
  • How does one specifically access VRAM, or AGP RAM?
  • Once the geometry is stored in the VRAM/AGP RAM, how does one actually use the API (eg. DirectX) to render the geometry?

Monder
Aug 25, 2003 at 3:44 AM
The V stands for Video.

The way to access and use the VRAM is API specific, I have no idea how it is accomplished in DX but for OGL check out the vertex buffer object extension.

poly-gone
Aug 25, 2003 at 8:38 AM
Here’s how one renders stuff using DirectX VBs :-

  • Load your object
  • Create a vertex buffer
  • Lock it
  • Copy the vertices from the object into the VB
  • Unlock it
  • Set the stream source
  • Set the shaders
  • Render using Primitives (Tristrips are preferable, especially with Index Buffers)

The first two tutorials in the DirectX SDK show exactly how to do this.