diff options
author | José Fonseca <[email protected]> | 2013-04-23 19:40:05 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2013-04-23 19:42:47 +0100 |
commit | 2737abb44efebfa10ac84b183c20fc5818d1514e (patch) | |
tree | 32447cf1ab7291a489bca9dd770c3e424785dbd9 /src/gallium/docs | |
parent | b69207642079fe8ba33c594750415e8d9c66a06f (diff) |
gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center.
Squashed commit of the following:
commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852
Author: José Fonseca <[email protected]>
Date: Tue Apr 23 17:37:18 2013 +0100
gallium: s/lower_left_origin/bottom_edge_rule/
commit 4dff4f64fa83b9737def136fffd161d55e4f1722
Author: José Fonseca <[email protected]>
Date: Tue Apr 23 17:35:04 2013 +0100
gallium: Move diagram to docs.
commit 442a63012c8c3c3797f45e03f2ca20ad5f399832
Author: James Benton <[email protected]>
Date: Fri May 11 17:50:55 2012 +0100
gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center.
This change is necessary to achieve correct results when using OpenGL
FBOs.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/docs')
-rw-r--r-- | src/gallium/docs/source/cso/rasterizer.rst | 73 | ||||
-rw-r--r-- | src/gallium/docs/source/tgsi.rst | 2 |
2 files changed, 71 insertions, 4 deletions
diff --git a/src/gallium/docs/source/cso/rasterizer.rst b/src/gallium/docs/source/cso/rasterizer.rst index be4bad56c00..44e5544cdaa 100644 --- a/src/gallium/docs/source/cso/rasterizer.rst +++ b/src/gallium/docs/source/cso/rasterizer.rst @@ -238,9 +238,76 @@ scissor multisample Whether :term:`MSAA` is enabled. -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. +half_pixel_center + When true, the rasterizer should use (0.5, 0.5) pixel centers for + determining pixel ownership (e.g, OpenGL, D3D10 and higher):: + + 0 0.5 1 + 0 +-----+ + | | + 0.5 | X | + | | + 1 +-----+ + + When false, the rasterizer should use (0, 0) pixel centers for determining + pixel ownership (e.g., D3D9 or ealier):: + + -0.5 0 0.5 + -0.5 +-----+ + | | + 0 | X | + | | + 0.5 +-----+ + +bottom_edge_rule + Determines what happens when a pixel sample lies precisely on a triangle + edge. + + When true, a pixel sample is considered to lie inside of a triangle if it + lies on the *bottom edge* or *left edge* (e.g., OpenGL drawables):: + + 0 x + 0 +---------------------> + | + | +-------------+ + | | | + | | | + | | | + | +=============+ + | + y V + + When false, a pixel sample is considered to lie inside of a triangle if it + lies on the *top edge* or *left edge* (e.g., OpenGL FBOs, D3D):: + + 0 x + 0 +---------------------> + | + | +=============+ + | | | + | | | + | | | + | +-------------+ + | + y V + + Where: + - a *top edge* is an edge that is horizontal and is above the other edges; + - a *bottom edge* is an edge that is horizontal and is below the other + edges; + - a *left edge* is an edge that is not horizontal and is on the left side of + the triangle. + + .. note:: + + Actually all graphics APIs use a top-left rasterization rule for pixel + ownership, but their notion of top varies with the axis origin (which + can be either at y = 0 or at y = height). Gallium instead always + assumes that top is always at y=0. + + See also: + - http://msdn.microsoft.com/en-us/library/windows/desktop/cc627092.aspx + - http://msdn.microsoft.com/en-us/library/windows/desktop/bb147314.aspx clip_halfz When true clip space in the z axis goes from [0..1] (D3D). When false diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 03bbd6fd23a..0a5b2274a9a 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -2168,7 +2168,7 @@ If HALF_INTEGER, the fractionary part of the position will be 0.5 If INTEGER, the fractionary part of the position will be 0.0 Note that this does not affect the set of fragments generated by -rasterization, which is instead controlled by gl_rasterization_rules in the +rasterization, which is instead controlled by half_pixel_center in the rasterizer. OpenGL defaults to HALF_INTEGER, and is configurable with the |