core
array_cache
math
swrast
swrast_setup
tnl
tnl_dd
Main Page Data Structures File List Data Fields Globals
The TNL-module
6.1
TNL stands for "transform and lighting", i.e. this module implements a pipeline that receives as input a buffer of vertices and does all necessary transformations (rotations, clipping, vertex shader etc.) and passes then the output to the rasterizer.
The tnl_pipeline contains the array of all stages, which should be applied. Each stage is a black-box, which is described by an tnl_pipeline_stage. The function _tnl_run_pipeline applies all the stages to the vertex_buffer TNLcontext::vb, where the vertex data is stored. The last stage in the pipeline is the rasterizer.
The initial vertex_buffer data may either come from an immediate structure or client vertex_arrays or display lists:
- The immediate structure records all the GL commands issued between glBegin and glEnd.
The structure accumulates data, until it is either full or it is flushed (usually by a state change). Before starting then the pipeline, the collected vertex data in immediate has to be pushed into TNLcontext::vb. This happens in _tnl_vb_bind_immediate. The pipeline is then run by calling tnl_device_driver::RunPipeline = _tnl_run_pipeline, which is stored in TNLcontext::Driver.
An immediate does (for performance reasons) usually not finish with a glEnd, and hence it also does not need to start with a glBegin. This means that the last vertices of one immediate may need to be saved for the next one.
- NOT SURE ABOUT THIS: The vertex_arrays structure is used to handle glDrawArrays etc.
Here, the data of the vertex_arrays is copied by _tnl_vb_bind_arrays into TNLcontext::vb, so that the pipeline can be started.
Generated on Sun May 16 15:55:27 2004 for Mesa Transform and Lighting (tnl) by
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001