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

Jose Fonseca jfonseca at vmware.com
Tue Apr 23 11:38:00 PDT 2013


----- Original Message -----
> This looks good to me. 

Thanks.

> bottom_edge_rule should probably also be set
> conditionally for Bitmap, Clear, and DrawPixels like this:
> 
> bottom_edge_rule = st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP;

I will do that in a follow on change.

Jose

> Marek
> 
> On Tue, Apr 23, 2013 at 6:39 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> > My follow on changes can be seen at
> > http://cgit.freedesktop.org/~jrfonseca/mesa/log/?h=gl-rasterization-rules
> >
> > Jose
> >
> > ----- Original Message -----
> >> Ok. I've moved the docs to src/gallium/docs/source/cso/rasterizer.rst ,
> >> and
> >> renamed `lower_left_origin` to `bottom_edge_rule`.
> >>
> >> This is how it looks like:
> >>
> >>   http://people.freedesktop.org/~jrfonseca/gl_rasterization_rules/cso/rasterizer.html#other-members
> >>
> >> Jose
> >>
> >> ----- Original Message -----
> >> > 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
> >> >
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >>
> 


More information about the mesa-dev mailing list