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