gallium: remove point_size_min and point_size_max from rasterizer state
[mesa.git] / src / gallium / docs / source / cso / rasterizer.rst
1 .. _rasterizer:
2
3 Rasterizer
4 ==========
5
6 The rasterizer state controls the rendering of points, lines and triangles.
7 Attributes include polygon culling state, line width, line stipple,
8 multisample state, scissoring and flat/smooth shading.
9
10
11 Members
12 -------
13
14 flatshade
15 If set, the provoking vertex of each polygon is used to determine the
16 color of the entire polygon. If not set, fragment colors will be
17 interpolated between the vertex colors.
18 Note that this is separate from the fragment shader input attributes
19 CONSTANT, LINEAR and PERSPECTIVE. We need the flatshade state at
20 clipping time to determine how to set the color of new vertices.
21 Also note that the draw module can implement flat shading by copying
22 the provoking vertex color to all the other vertices in the primitive.
23
24 flatshade_first
25 Whether the first vertex should be the provoking vertex, for most
26 primitives. If not set, the last vertex is the provoking vertex.
27
28 light_twoside
29 If set, there are per-vertex back-facing colors. The draw module
30 uses this state along with the front/back information to set the
31 final vertex colors prior to rasterization.
32
33 front_winding
34 Indicates the window order of front-facing polygons, either
35 PIPE_WINDING_CW or PIPE_WINDING_CCW
36 cull_mode
37 Indicates which polygons to cull, either PIPE_WINDING_NONE (cull no
38 polygons), PIPE_WINDING_CW (cull clockwise-winding polygons),
39 PIPE_WINDING_CCW (cull counter clockwise-winding polygons), or
40 PIPE_WINDING_BOTH (cull all polygons).
41
42 fill_cw
43 Indicates how to fill clockwise polygons, either PIPE_POLYGON_MODE_FILL,
44 PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
45 fill_ccw
46 Indicates how to fill counter clockwise polygons, either
47 PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
48
49 poly_stipple_enable
50 Whether polygon stippling is enabled.
51 poly_smooth
52 Controls OpenGL-style polygon smoothing/antialiasing
53 offset_cw
54 If set, clockwise polygons will have polygon offset factors applied
55 offset_ccw
56 If set, counter clockwise polygons will have polygon offset factors applied
57 offset_units
58 Specifies the polygon offset bias
59 offset_scale
60 Specifies the polygon offset scale
61
62 line_width
63 The width of lines.
64 line_smooth
65 Whether lines should be smoothed. Line smoothing is simply anti-aliasing.
66 line_stipple_enable
67 Whether line stippling is enabled.
68 line_stipple_pattern
69 16-bit bitfield of on/off flags, used to pattern the line stipple.
70 line_stipple_factor
71 When drawinga stippled line, each bit in the stipple pattern is
72 repeated N times, where N = line_stipple_factor + 1.
73 line_last_pixel
74 Controls whether the last pixel in a line is drawn or not. OpenGL
75 omits the last pixel to avoid double-drawing pixels at the ends of lines
76 when drawing connected lines.
77
78 point_smooth
79 Whether points should be smoothed. Point smoothing turns rectangular
80 points into circles or ovals.
81 point_size_per_vertex
82 Whether vertices have a point size element.
83 point_size
84 The size of points, if not specified per-vertex.
85 point_sprite
86 Whether points are drawn as sprites (textured quads)
87 sprite_coord_mode
88 Specifies how the value for each shader output should be computed when
89 drawing sprites. If PIPE_SPRITE_COORD_NONE, don't change the vertex
90 shader output. Otherwise, the four vertices of the resulting quad will
91 be assigned texture coordinates. For PIPE_SPRITE_COORD_LOWER_LEFT, the
92 lower left vertex will have coordinate (0,0,0,1).
93 For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left vertex will have
94 coordinate (0,0,0,1).
95 This state is needed by the 'draw' module because that's where each
96 point vertex is converted into four quad vertices. There's no other
97 place to emit the new vertex texture coordinates which are required for
98 sprite rendering.
99 Note that when geometry shaders are available, this state could be
100 removed. A special geometry shader defined by the state tracker could
101 converts the incoming points into quads with the proper texture coords.
102
103 scissor
104 Whether the scissor test is enabled.
105
106 multisample
107 Whether :ref:`MSAA` is enabled.
108
109 bypass_vs_clip_and_viewport
110 Whether the entire TCL pipeline should be bypassed. This implies that
111 vertices are pre-transformed for the viewport, and will not be run
112 through the vertex shader. Note that implementations may still clip away
113 vertices that are not in the viewport.
114
115 gl_rasterization_rules
116 Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
117 the rasterizer will use (0, 0) for pixel centers.
118
119
120 Notes
121 -----
122
123 flatshade
124 ^^^^^^^^^
125
126 The actual interpolated shading algorithm is obviously
127 implementation-dependent, but will usually be Gourard for most hardware.
128
129 bypass_vs_clip_and_viewport
130 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
132 When set, this implies that vertices are pre-transformed for the viewport, and
133 will not be run through the vertex shader. Note that implementations may still
134 clip away vertices that are not visible.
135
136 flatshade_first
137 ^^^^^^^^^^^^^^^
138
139 There are several important exceptions to the specification of this rule.
140
141 * ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first
142 vertex. If the caller wishes to change the provoking vertex, they merely
143 need to rotate the vertices themselves.
144 * ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: This option has no
145 effect; the provoking vertex is always the last vertex.
146 * ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the
147 second vertex, not the first. This permits each segment of the fan to have
148 a different color.