[Mesa-dev] [PATCH 2/2] gallium: Replaced gl_rasterization_rules with lower_left_origin and half_pixel_center.

Marek Olšák maraeo at gmail.com
Sun Apr 21 15:07:26 PDT 2013


Yeah, I was confused when reading the comment and the diagrams. It
probably shouldn't mention the screen origin at all and instead should
say which one of the top and bottom edges is inclusive and which one
is exclusive when determining pixel ownership.

Anyway, thank you for fixing this. I would have probably never knew
how to fix the triangle rasterization tests if you didn't bring this
up.

Marek

On Sun, Apr 21, 2013 at 7:54 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> ----- Original Message -----
>> Some suggestions for the name:
>>
>> lower_left_edge_rule
>> lower_left_rasterization_edge_rule
>> gl_edge_rule
>> gl_rasterization_edge_rule
>>
>> In this case, the name is not as important as the documentation which
>> defines the behavior of the state.
>
> On that note, I thought that James' diagrams were pretty good.  Maybe the axis is misleading.
>
>
> +   /**
> +    * Triangle rasterization always uses a 'top,left' rule for pixel ownership,
> +    * this just alters what we consider to be the top edge for that test.
> +    *
> +    * When true, screen coordinates origin is considered to be at bottom-left
> +    * (e.g., OpenGL drawables):
> +    *
> +    *  y ^
> +    *    |
> +    *    |  +=============+ <- top edge
> +    *    |  |             |
> +    *    |  |             |
> +    *    |  |             |
> +    *    |  +-------------+
> +    *    |
> +    *  0 +--------------------->
> +    *    0                    x
> +    *
> +    *  When false, screen coordinates origin is considered to be at top-left
> +    *  (e.g., OpenGL FBOs, D3D):
> +    *
> +    *    0                    x
> +    *  0 +--------------------->
> +    *    |
> +    *    |  +=============+ <- top edge
> +    *    |  |             |
> +    *    |  |             |
> +    *    |  |             |
> +    *    |  +-------------+
> +    *    |
> +    *  y V
>      *
> -    * Triangle rasterization always uses a 'top,left' rule for pixel
> -    * ownership, this just alters which point we consider the pixel
> -    * center for that test.
> +    * See also:
> +    * - http://www.opengl.org/registry/specs/ARB/fragment_coord_conventions.txt
> +    * - http://msdn.microsoft.com/en-us/library/windows/desktop/cc627092.aspx
> +    * - http://msdn.microsoft.com/en-us/library/windows/desktop/bb147314.aspx
>      */
> -   unsigned gl_rasterization_rules:1;
> +   unsigned lower_left_origin:1;
>
>     /**
>      * When true, rasterization is disabled and no pixels are written.
>
> Jose


More information about the mesa-dev mailing list