summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/source/cso
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/docs/source/cso')
-rw-r--r--src/gallium/docs/source/cso/blend.rst14
-rw-r--r--src/gallium/docs/source/cso/dsa.rst58
-rw-r--r--src/gallium/docs/source/cso/rasterizer.rst152
-rw-r--r--src/gallium/docs/source/cso/sampler.rst46
-rw-r--r--src/gallium/docs/source/cso/shader.rst12
5 files changed, 282 insertions, 0 deletions
diff --git a/src/gallium/docs/source/cso/blend.rst b/src/gallium/docs/source/cso/blend.rst
new file mode 100644
index 00000000000..fd9e4a1e2d5
--- /dev/null
+++ b/src/gallium/docs/source/cso/blend.rst
@@ -0,0 +1,14 @@
+.. _blend:
+
+Blend
+=====
+
+This state controls blending of the final fragments into the target rendering
+buffers.
+
+XXX it is unresolved what behavior should result if blend_enable is off.
+
+Members
+-------
+
+XXX undocumented members
diff --git a/src/gallium/docs/source/cso/dsa.rst b/src/gallium/docs/source/cso/dsa.rst
new file mode 100644
index 00000000000..12abaa9d6fe
--- /dev/null
+++ b/src/gallium/docs/source/cso/dsa.rst
@@ -0,0 +1,58 @@
+.. _depth,stencil,&alpha:
+
+Depth, Stencil, & Alpha
+=======================
+
+These three states control the depth, stencil, and alpha tests, used to
+discard fragments that have passed through the fragment shader.
+
+Traditionally, these three tests have been clumped together in hardware, so
+they are all stored in one structure.
+
+During actual execution, the order of operations done on fragments is always:
+
+* Stencil
+* Depth
+* Alpha
+
+Depth Members
+-------------
+
+enabled
+ Whether the depth test is enabled.
+writemask
+ Whether the depth buffer receives depth writes.
+func
+ The depth test function. One of PIPE_FUNC.
+
+Stencil Members
+---------------
+
+XXX document valuemask, writemask
+
+enabled
+ Whether the stencil test is enabled. For the second stencil, whether the
+ two-sided stencil is enabled.
+func
+ The stencil test function. One of PIPE_FUNC.
+ref_value
+ Stencil test reference value; used for certain functions.
+fail_op
+ The operation to carry out if the stencil test fails. One of
+ PIPE_STENCIL_OP.
+zfail_op
+ The operation to carry out if the stencil test passes but the depth test
+ fails. One of PIPE_STENCIL_OP.
+zpass_op
+ The operation to carry out if the stencil test and depth test both pass.
+ One of PIPE_STENCIL_OP.
+
+Alpha Members
+-------------
+
+enabled
+ Whether the alpha test is enabled.
+func
+ The alpha test function. One of PIPE_FUNC.
+ref_value
+ Alpha test reference value; used for certain functions.
diff --git a/src/gallium/docs/source/cso/rasterizer.rst b/src/gallium/docs/source/cso/rasterizer.rst
new file mode 100644
index 00000000000..4d8e1708e7c
--- /dev/null
+++ b/src/gallium/docs/source/cso/rasterizer.rst
@@ -0,0 +1,152 @@
+.. _rasterizer:
+
+Rasterizer
+==========
+
+The rasterizer state controls the rendering of points, lines and triangles.
+Attributes include polygon culling state, line width, line stipple,
+multisample state, scissoring and flat/smooth shading.
+
+
+Members
+-------
+
+flatshade
+ If set, the provoking vertex of each polygon is used to determine the
+ color of the entire polygon. If not set, fragment colors will be
+ interpolated between the vertex colors.
+ Note that this is separate from the fragment shader input attributes
+ 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
+ Whether polygon stippling is enabled.
+poly_smooth
+ Controls OpenGL-style polygon smoothing/antialiasing
+offset_cw
+ If set, clockwise polygons will have polygon offset factors applied
+offset_ccw
+ If set, counter clockwise polygons will have polygon offset factors applied
+offset_units
+ Specifies the polygon offset bias
+offset_scale
+ Specifies the polygon offset scale
+
+line_width
+ The width of lines.
+line_smooth
+ Whether lines should be smoothed. Line smoothing is simply anti-aliasing.
+line_stipple_enable
+ Whether line stippling is enabled.
+line_stipple_pattern
+ 16-bit bitfield of on/off flags, used to pattern the line stipple.
+line_stipple_factor
+ When drawinga stippled line, each bit in the stipple pattern is
+ repeated N times, where N = line_stipple_factor + 1.
+line_last_pixel
+ Controls whether the last pixel in a line is drawn or not. OpenGL
+ omits the last pixel to avoid double-drawing pixels at the ends of lines
+ when drawing connected lines.
+
+point_smooth
+ Whether points should be smoothed. Point smoothing turns rectangular
+ points into circles or ovals.
+point_size_per_vertex
+ Whether vertices have a point size element.
+point_size
+ The size of points, if not specified per-vertex.
+point_size_min
+ The minimum size of points.
+point_size_max
+ 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
+-----
+
+flatshade
+^^^^^^^^^
+
+The actual interpolated shading algorithm is obviously
+implementation-dependent, but will usually be Gourard for most hardware.
+
+bypass_vs_clip_and_viewport
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When set, 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 visible.
+
+flatshade_first
+^^^^^^^^^^^^^^^
+
+There are several important exceptions to the specification of this rule.
+
+* ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first
+ vertex. If the caller wishes to change the provoking vertex, they merely
+ need to rotate the vertices themselves.
+* ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: This option has no
+ effect; the provoking vertex is always the last vertex.
+* ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the
+ second vertex, not the first. This permits each segment of the fan to have
+ a different color.
diff --git a/src/gallium/docs/source/cso/sampler.rst b/src/gallium/docs/source/cso/sampler.rst
new file mode 100644
index 00000000000..e3f1757f57a
--- /dev/null
+++ b/src/gallium/docs/source/cso/sampler.rst
@@ -0,0 +1,46 @@
+.. _sampler:
+
+Sampler
+=======
+
+Texture units have many options for selecting texels from loaded textures;
+this state controls an individual texture unit's texel-sampling settings.
+
+Texture coordinates are always treated as four-dimensional, and referred to
+with the traditional (S, T, R, Q) notation.
+
+Members
+-------
+
+XXX undocumented compare_mode, compare_func
+
+wrap_s
+ How to wrap the S coordinate. One of PIPE_TEX_WRAP.
+wrap_t
+ How to wrap the T coordinate. One of PIPE_TEX_WRAP.
+wrap_r
+ How to wrap the R coordinate. One of PIPE_TEX_WRAP.
+min_img_filter
+ The filter to use when minifying texels. One of PIPE_TEX_FILTER.
+min_mip_filter
+ The filter to use when minifying mipmapped textures. One of
+ PIPE_TEX_FILTER.
+mag_img_filter
+ The filter to use when magnifying texels. One of PIPE_TEX_FILTER.
+normalized_coords
+ Whether the texture coordinates are normalized. If normalized, they will
+ always be in [0, 1]. If not, they will be in the range of each dimension
+ of the loaded texture.
+prefilter
+ XXX From the Doxy, "weird sampling state exposed by some APIs." Refine.
+lod_bias
+ The bias to apply to the level of detail.
+min_lod
+ Minimum level of detail, used to clamp LoD after bias.
+max_lod
+ Maximum level of detail, used to clamp LoD after bias.
+border_color
+ RGBA color used for out-of-bounds coordinates.
+max_anisotropy
+ Maximum filtering to apply anisotropically to textures. Setting this to
+ 1.0 effectively disables anisotropic filtering.
diff --git a/src/gallium/docs/source/cso/shader.rst b/src/gallium/docs/source/cso/shader.rst
new file mode 100644
index 00000000000..0ee42c87876
--- /dev/null
+++ b/src/gallium/docs/source/cso/shader.rst
@@ -0,0 +1,12 @@
+.. _shader:
+
+Shader
+======
+
+One of the two types of shaders supported by Gallium.
+
+Members
+-------
+
+tokens
+ A list of tgsi_tokens.