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.
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.
25 Whether the first vertex should be the provoking vertex, for most
26 primitives. If not set, the last vertex is the provoking vertex.
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.
34 Indicates the window order of front-facing polygons, either
35 PIPE_WINDING_CW or PIPE_WINDING_CCW
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).
43 Indicates how to fill clockwise polygons, either PIPE_POLYGON_MODE_FILL,
44 PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
46 Indicates how to fill counter clockwise polygons, either
47 PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
50 Whether polygon stippling is enabled.
52 Controls OpenGL-style polygon smoothing/antialiasing
54 If set, clockwise polygons will have polygon offset factors applied
56 If set, counter clockwise polygons will have polygon offset factors applied
58 Specifies the polygon offset bias
60 Specifies the polygon offset scale
65 Whether lines should be smoothed. Line smoothing is simply anti-aliasing.
67 Whether line stippling is enabled.
69 16-bit bitfield of on/off flags, used to pattern the line stipple.
71 When drawinga stippled line, each bit in the stipple pattern is
72 repeated N times, where N = line_stipple_factor + 1.
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.
79 Whether points should be smoothed. Point smoothing turns rectangular
80 points into circles or ovals.
82 Whether vertices have a point size element.
84 The size of points, if not specified per-vertex.
86 Specifies if a coord has its texture coordinates replaced or not. This
87 is a packed bitfield containing the enable for all coords - if all are 0
88 point sprites are effectively disabled, though points may still be
89 rendered slightly different according to point_quad_rasterization.
90 If any coord is non-zero, point_smooth should be disabled, and
91 point_quad_rasterization enabled.
92 If enabled, the four vertices of the resulting quad will be assigned
93 texture coordinates, according to sprite_coord_mode.
95 Specifies how the value for each shader output should be computed when
96 drawing sprites, for each coord which has sprite_coord_enable set.
97 For PIPE_SPRITE_COORD_LOWER_LEFT, the lower left vertex will have
99 For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left vertex will have
100 coordinate (0,0,0,1).
101 This state is needed by the 'draw' module because that's where each
102 point vertex is converted into four quad vertices. There's no other
103 place to emit the new vertex texture coordinates which are required for
105 Note that when geometry shaders are available, this state could be
106 removed. A special geometry shader defined by the state tracker could
107 convert the incoming points into quads with the proper texture coords.
108 point_quad_rasterization
109 This determines if points should be rasterized as quads or points.
110 d3d always uses quad rasterization for points, regardless if point sprites
111 are enabled or not, but OGL has different rules. If point_quad_rasterization
112 is set, point_smooth should be disabled, and points will be rendered as
113 squares even if multisample is enabled.
114 sprite_coord_enable should be zero if point_quad_rasterization is not
118 Whether the scissor test is enabled.
121 Whether :ref:`MSAA` is enabled.
123 bypass_vs_clip_and_viewport
124 Whether the entire TCL pipeline should be bypassed. This implies that
125 vertices are pre-transformed for the viewport, and will not be run
126 through the vertex shader. Note that implementations may still clip away
127 vertices that are not in the viewport.
129 gl_rasterization_rules
130 Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
131 the rasterizer will use (0, 0) for pixel centers.
140 The actual interpolated shading algorithm is obviously
141 implementation-dependent, but will usually be Gourard for most hardware.
143 bypass_vs_clip_and_viewport
144 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
146 When set, this implies that vertices are pre-transformed for the viewport, and
147 will not be run through the vertex shader. Note that implementations may still
148 clip away vertices that are not visible.
153 There are several important exceptions to the specification of this rule.
155 * ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first
156 vertex. If the caller wishes to change the provoking vertex, they merely
157 need to rotate the vertices themselves.
158 * ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: This option has no
159 effect; the provoking vertex is always the last vertex.
160 * ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the
161 second vertex, not the first. This permits each segment of the fan to have