1INTRODUCTION 2 3A helper module which provides glue to bind the software rasterizer to 4the software t&l module. The main task of this module is to build 5swrast vertices from the t&l vertex_buffer structs, and to use them to 6perform triangle setup functions not implemented in the software 7rasterizer. 8 9The module implements a full set of functions to plug into the 10t_vb_render.c driver interface (tnl->Driver.Render.*). 11 12There are strong advantages to decoupling the software rasterizer from 13the t&l module, primarily allowing hardware drivers better control 14over fallbacks, the removal of implicit knowledge about the software 15rasterizer in the t&l module, allowing the two modules to evolve 16independently and allowing either to be substituted with equivalent 17functionality from another codebase. 18 19This module implements triangle/quad setup for offset, unfilled and 20twoside-lit triangles. The software rasterizer doesn't handle these 21primitives directly. 22 23Hardware rasterization drivers typically use this module in situations 24where no hardware rasterization is possible, ie during total 25fallbacks. 26 27STATE 28 29To create and destroy the module: 30 31 GLboolean _swsetup_CreateContext( struct gl_context *ctx ); 32 void _swsetup_DestroyContext( struct gl_context *ctx ); 33 34The module is not active by default, and must be installed by calling 35_swrast_Wakeup(). This function installs internal swrast_setup 36functions into all the tnl->Driver.Render driver hooks, thus taking 37over the task of rasterization entirely: 38 39 void _swrast_Wakeup( struct gl_context *ctx ); 40 41 42This module tracks state changes internally and maintains derived 43values based on the current state. For this to work, the driver 44ensure the following funciton is called whenever the state changes and 45the swsetup module is 'awake': 46 47 void _swsetup_InvalidateState( struct gl_context *ctx, GLuint new_state ); 48 49There is no explicit call to put the swsetup module to sleep. Simply 50install other function pointers into all the tnl->Driver.Render.* 51hooks, and (optionally) cease calling _swsetup_InvalidateState(). 52 53DRIVER INTERFACE 54 55The module offers a minimal driver interface: 56 57 void (*Start)( struct gl_context *ctx ); 58 void (*Finish)( struct gl_context *ctx ); 59 60These are called before and after the completion of all swrast drawing 61activity. As swrast doesn't call callbacks during triangle, line or 62point rasterization, these are necessary to provide locking hooks for 63some drivers. They may otherwise be left null. 64 65 66