1INTRODUCTION 2 3Mesa's native software rasterizer. This module provides the fallback 4paths for rasterization operations and states that aren't accelerated 5in hardware drivers, and as the full rasterization engine in software 6drivers. 7 8The swrast module 'stands alone', relying only on interfaces to core 9mesa and it's own driver interface. It knows nothing about the tnl or 10other modules, allowing it to be used for fallback paths in future tnl 11schemes without modification. 12 13As well as providing triangle/line/point rasterization functionality, 14the module provides implementations of the pixel operations 15(ReadPixels, etc), and texture operations (CopyTexSubImage) which may 16be plugged in to the core Mesa driver interface where accelerated 17versions of these operations are unavailable. 18 19 20STATE 21 22To create and destroy the module: 23 24 GLboolean _swrast_CreateContext( struct gl_context *ctx ); 25 void _swrast_DestroyContext( struct gl_context *ctx ); 26 27This module tracks state changes internally and maintains derived 28values based on the current state. For this to work, the driver 29ensure the following funciton is called whenever the state changes and 30the swsetup module is 'awake': 31 32 void _swrast_InvalidateState( struct gl_context *ctx, GLuint new_state ); 33 34There is no explicit call to put the swrast module to sleep. 35 36 37CUSTOMIZATION 38 39 void (*choose_point)( struct gl_context * ); 40 void (*choose_line)( struct gl_context * ); 41 void (*choose_triangle)( struct gl_context * ); 42 43Drivers may add additional triangle/line/point functions to swrast by 44overriding these functions. It is necessary for the driver to be very 45careful that it doesn't return an inappropriate function, eg a 46rasterization function in feedback mode. See the X11 driver for 47examples. 48 49DRIVER INTERFACE 50 51The swrast device driver provides swrast primarily with span- and 52pixel- level interfaces to a framebuffer, with a few additional hooks 53for locking and setting the read buffer. 54 55See the definition of struct swrast_device_driver in swrast.h.