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