4 These files are incomplete. They do not yet form a working
5 implementation of hte concepts discused below.
10 The t_dd_imm_* files form a set of templates to produce driver -
11 specific software tnl modules for a small subset of transformation and
14 The approach is quite different to the large vertex buffers of the
15 src/tnl module, and is based around a cache of four recent vertices
16 and a 'current' vertex which is updated directly from the Color,
17 Normal, Texcoord, SecondaryColor and Fog entrypoints.
19 The current vertex is actually a composite of the ctx->Current values
20 and a partial hardware vertex maintained where the hardware values
21 differ from those in ctx->Current. For example, clamped color values
22 are kept in the hardware vertex, while texcoords remain in
27 +--------------+ +-------------------+
28 | ctx->Current | | Current-HW-vertex |
29 +--------------+ +-------------------+
37 +--------+ +--------+ +--------+ +--------+
38 | vert-0 | | vert-1 | | vert-2 | | vert-3 |
39 +--------+ +--------+ +--------+ +--------+
47 Here values from ctx->Current and current-HW-vertex are merged to
48 build vert-2, which is then dumped to hardware (DMA). A state machine
49 determines which vertex is built in turn, and how the vertices are
50 used to present primitives to hardware. These actions all occur
51 during a call to Vertex{234}f{v}.
53 Each vert-n includes clip coordinates and a clipmask in addition to
54 the hardware (window) coordinates. This information allows clipping
55 to take place directly on these vertices, if need be.
59 Color{34}{fub}{v}() implementations. These update both
60 ctx->Current (unclamped float colors) and current-HW-vertex
61 with hardware-specific color values (typically unsigned
64 When lighting is enabled, the functions from src/api_noop.c
65 should be used, which just update ctx->Current. (The
66 current-hw-vertex colors are produced from lighting, which is
71 Support functions for clipping and fallback. See
77 Versions of Normal3f{v} to perform lighting with one or more
78 infinite lights. Updates ctx->Current.Normal and the current
81 When lighting is disabled, use the functions from api_noop.c
87 State machine to control emission of vertices and primitives
88 to hardware. Called indirectly from Vertex{234}f{v}. Capable
89 of supporting hardware strip and fan primitives, and of
90 decomposing to discreet primitives for clipping or fallback,
91 or where the native primitive is unavailable.
95 Implementations of TexCoord{v} and MultiTexCoord4f{v}ARB to
96 fire a callback when transitioning to projective texture.
97 Most drivers will need to change vertex format at this point,
98 some may need to enable a software rasterization fallback.
102 Implementations of Vertex{234}f{v}. These perform
103 transformation and cliptesting on their arguments, then jump
104 into the state machine implemented in primtmp.h.
108 Support functions for building and clip-interpolating hardware
109 vertices. Called from primtmp.h.
112 Keith Whitwell, June 2001.