PDA

View Full Version : Vertex programs: cached ?



Julien Cayzac
02-05-2002, 11:24 PM
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) ?

Thanks,
Julien.

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

Zak McKrakem
02-06-2002, 01:12 AM
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."
(From http://www.3dlabs.com/support/developer/ogl2/OGL2_Overview_1.1.pdf)

Julien Cayzac
02-06-2002, 08:01 AM
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 ! http://www.opengl.org/discussion_boards/ubb/smile.gif
What's up with its schedule ?

Julien.

Korval
02-06-2002, 02:48 PM
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.

mcraighead
02-06-2002, 03:20 PM
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