gallium/docs: finish up description of pipe_rasterizer_state fields

This commit is contained in:
Brian Paul
2010-01-06 09:42:53 -07:00
parent 251363e8f1
commit 439b34c9dd

View File

@@ -3,58 +3,123 @@
Rasterizer Rasterizer
========== ==========
The rasterizer is the main chunk of state controlling how vertices are The rasterizer state controls the rendering of points, lines and triangles.
interpolated into fragments. Attributes include polygon culling state, line width, line stipple,
multisample state, scissoring and flat/smooth shading.
Members Members
------- -------
XXX undocumented light_twoside, front_winding, cull_mode, fill_cw, fill_ccw, offset_cw, offset_ccw
XXX moar undocumented poly_smooth, line_stipple_factor, line_last_pixel, offset_units, offset_scale
XXX sprite_coord_mode
flatshade flatshade
If set, the provoking vertex of each polygon is used to determine the If set, the provoking vertex of each polygon is used to determine the
color of the entire polygon. If not set, the color fragments will be color of the entire polygon. If not set, fragment colors will be
interpolated from each vertex's color. interpolated between the vertex colors.
scissor Note that this is separate from the fragment shader input attributes
Whether the scissor test is enabled. CONSTANT, LINEAR and PERSPECTIVE. We need the flatshade state at
clipping time to determine how to set the color of new vertices.
Also note that the draw module can implement flat shading by copying
the provoking vertex color to all the other vertices in the primitive.
flatshade_first
Whether the first vertex should be the provoking vertex, for most
primitives. If not set, the last vertex is the provoking vertex.
light_twoside
If set, there are per-vertex back-facing colors. The draw module
uses this state along with the front/back information to set the
final vertex colors prior to rasterization.
front_winding
Indicates the window order of front-facing polygons, either
PIPE_WINDING_CW or PIPE_WINDING_CCW
cull_mode
Indicates which polygons to cull, either PIPE_WINDING_NONE (cull no
polygons), PIPE_WINDING_CW (cull clockwise-winding polygons),
PIPE_WINDING_CCW (cull counter clockwise-winding polygons), or
PIPE_WINDING_BOTH (cull all polygons).
fill_cw
Indicates how to fill clockwise polygons, either PIPE_POLYGON_MODE_FILL,
PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
fill_ccw
Indicates how to fill counter clockwise polygons, either
PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or PIPE_POLYGON_MODE_POINT.
poly_stipple_enable poly_stipple_enable
Whether polygon stippling is enabled. Whether polygon stippling is enabled.
point_smooth poly_smooth
Whether points should be smoothed. Point smoothing turns rectangular Controls OpenGL-style polygon smoothing/antialiasing
points into circles or ovals. offset_cw
point_sprite If set, clockwise polygons will have polygon offset factors applied
Whether point sprites are enabled. offset_ccw
point_size_per_vertex If set, counter clockwise polygons will have polygon offset factors applied
Whether vertices have a point size element. offset_units
multisample Specifies the polygon offset bias
Whether :ref:`MSAA` is enabled. offset_scale
Specifies the polygon offset scale
line_width
The width of lines.
line_smooth line_smooth
Whether lines should be smoothed. Line smoothing is simply anti-aliasing. Whether lines should be smoothed. Line smoothing is simply anti-aliasing.
line_stipple_enable line_stipple_enable
Whether line stippling is enabled. Whether line stippling is enabled.
line_stipple_pattern line_stipple_pattern
16-bit bitfield of on/off flags, used to pattern the line stipple. 16-bit bitfield of on/off flags, used to pattern the line stipple.
bypass_vs_clip_and_viewport line_stipple_factor
Whether the entire TCL pipeline should be bypassed. This implies that When drawinga stippled line, each bit in the stipple pattern is
vertices are pre-transformed for the viewport, and will not be run repeated N times, where N = line_stipple_factor + 1.
through the vertex shader. Note that implementations may still clip away line_last_pixel
vertices that are not in the viewport. Controls whether the last pixel in a line is drawn or not. OpenGL
flatshade_first omits the last pixel to avoid double-drawing pixels at the ends of lines
Whether the first vertex should be the provoking vertex, for most when drawing connected lines.
primitives. If not set, the last vertex is the provoking vertex.
gl_rasterization_rules point_smooth
Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set, Whether points should be smoothed. Point smoothing turns rectangular
the rasterizer will use (0, 0) for pixel centers. points into circles or ovals.
line_width point_size_per_vertex
The width of lines. Whether vertices have a point size element.
point_size point_size
The size of points, if not specified per-vertex. The size of points, if not specified per-vertex.
point_size_min point_size_min
The minimum size of points. The minimum size of points.
point_size_max point_size_max
The maximum size of points. The maximum size of points.
point_sprite
Whether points are drawn as sprites (textured quads)
sprite_coord_mode
Specifies how the value for each shader output should be computed when
drawing sprites. If PIPE_SPRITE_COORD_NONE, don't change the vertex
shader output. Otherwise, the four vertices of the resulting quad will
be assigned texture coordinates. For PIPE_SPRITE_COORD_LOWER_LEFT, the
lower left vertex will have coordinate (0,0,0,1).
For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left vertex will have
coordinate (0,0,0,1).
This state is needed by the 'draw' module because that's where each
point vertex is converted into four quad vertices. There's no other
place to emit the new vertex texture coordinates which are required for
sprite rendering.
Note that when geometry shaders are available, this state could be
removed. A special geometry shader defined by the state tracker could
converts the incoming points into quads with the proper texture coords.
scissor
Whether the scissor test is enabled.
multisample
Whether :ref:`MSAA` is enabled.
bypass_vs_clip_and_viewport
Whether the entire TCL pipeline should be bypassed. This implies that
vertices are pre-transformed for the viewport, and will not be run
through the vertex shader. Note that implementations may still clip away
vertices that are not in the viewport.
gl_rasterization_rules
Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
the rasterizer will use (0, 0) for pixel centers.
Notes Notes
----- -----