Vertex programs: cached ?

If I use a vertex program on vertices stored in a CVA and use multipass rendering, is the vertex program getting executed each pass or do the output registers get cached and reused after the first pass (provided there is no vertex program related changes between passes) ?


[This message has been edited by deepmind (edited 02-06-2002).]

The vertex program is executed each vertex and each pass.
In OGL2.0 you will have Aux Data Buffers for multipass purposes:
“OpenGL 2.0
defines a new type of buffer called the aux data buffer. This buffer is specifically designed to
hold floating-point data in order to provide a simple, generalized mechanism that enhances
programmability. It is the primary mechanism in OpenGL 2.0 for allowing applications to
directly implement multipass algorithms. It can be used to temporarily store multiple outputs
from the fragment processor, store intermediate results from a multipass algorithm, store results
from multi-spectral image processing operations, or as a destination for computing a floatingpoint
image that can then be read back to the host for archival or further processing.”

Originally posted by Zak McKrakem:
In OGL2.0 you will have Aux Data Buffers for multipass purposes.

Damn, I need OpenGL 2.0 (for other things too) right n… yesterday !
What’s up with its schedule ?


What makes you think that lots of implementations of vertex programs will be able to provide this for some time? They may fall back to software T&L in order to make this work.

There is no way to save post-T&L data. (Even that quote doesn’t appear to mention any way to store vertex program results.)

Even if there was a way, it might not prove useful. In some cases the extra bandwidth consumption would overwhelm the benefits. The memory consumption could also be arbitrarily large.

Just recompute the necessary things on each pass; it’s not that horrible to do.

Or, compute the shared things on the CPU once, and send them down per vertex in a vertex attribute, if they are easy for you to compute. This may also give you a bit of load balancing.

  • Matt