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 Whether points are drawn as sprites (textured quads)
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
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
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.
104 Whether the scissor test is enabled.
107 Whether :ref:`MSAA` is enabled.
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.
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.
126 The actual interpolated shading algorithm is obviously
127 implementation-dependent, but will usually be Gourard for most hardware.
129 bypass_vs_clip_and_viewport
130 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
139 There are several important exceptions to the specification of this rule.
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