<p dir="ltr">On Aug 4, 2016 10:33 AM, "Marek Olšák" <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
><br>
> On Thu, Aug 4, 2016 at 3:31 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > Hey Marek, Thanks for working on this!<br>
> ><br>
> > On Aug 4, 2016 7:39 AM, "Marek Olšák" <<a href="mailto:maraeo@gmail.com">maraeo@gmail.com</a>> wrote:<br>
> >><br>
> >> Hi,<br>
> >><br>
> >> This is my definition so far, which is an intersection of AMD and NV<br>
> >> rectangles:<br>
> >><br>
> >> Definition and behavior:<br>
> >> - The rectangle primitive is defined by its first 3 vertices.<br>
> >> - The 4th vertex is derived (extrapolated) during rasterization.<br>
> >> - It's treated as a triangle by all stages before rasterization.<br>
> >> - The rectangle edges must be parallel or perpendicular to X and Y<br>
> >> axes ("axis-aligned), i.e. the rectangle can only be rotated in<br>
> >> 90-degree increments and flipped over.<br>
> >> - It must be rasterized as a rectangle (no diagonal tearing allowed,<br>
> >> no artifacts on the diagonal allowed)<br>
> ><br>
> > More requirements:<br>
> > - Must be solid<br>
><br>
> I take it you mean the polygon mode.</p>
<p dir="ltr">Yes</p>
<p dir="ltr">> > - No cut index (GS is supposed to be fine and Tess looks OK too)<br>
><br>
> I'd be OK with dropping GS and Tess support for rectangles.</p>
<p dir="ltr">I don't know that we need to but the docs say cut index doesn't work.</p>
<p dir="ltr">> ><br>
> > Our hardware docs *say* that the vertices have to come in a particular<br>
> > order. That said, I've gotten it wrong without the hardware exploding<br>
> > before. I think we could write a Piglit test that checks all the orders and<br>
> > test for it fairly easily.<br>
><br>
> This is the most tricky one. I'd need a clear definition of what "a<br>
> particular order" means. The rasterization order is different between<br>
> windows and FBOs.</p>
<p dir="ltr">The docs say that you have to do it as follows:</p>
<p dir="ltr">v2---+<br>
| \ |<br>
| \ |<br>
| \|<br>
v1--v0</p>
<p dir="ltr">It also says that the fourth vertex is computed as v2 + v0 - v1 and had some words about screen alignment. But those are the docs which don't tell you how it works but rather "if you program it this way it will work". In reality it probably just takes the different edges from the different vertices or something like that. I don't know the details.</p>
<p dir="ltr">> > Also, clipping... The docs say that we can't clip them with the normal<br>
> > clipper. It also says that we need to disable the viewport which means we<br>
> > are left with no clipping whatsoever and OOB rectangles may write to random<br>
> > memory outside the surface. This is bad. Without further experimentation,<br>
> > I can't say how much of this is true and how much of it is just<br>
> > recommendation. Given that RECTLIST is intended for internal operations<br>
> > only, it could be anywhere on that spectrum and may be different on<br>
> > different hardware. We could, in theory apply the viewport and do clipping<br>
> > either in a geometry shader or as something we append onto the end of the<br>
> > VS. A bit ugly, but it would work.<br>
><br>
> I declared clipping as undefined, including frustum clipping. That<br>
> means all vertices must be inside the viewport and all user clipping<br>
> must be disabled.<br>
><br>
> If your driver uses guard bands (which skips clipping), it probably<br>
> also uses a scissor test of some kind to cull pixels out of viewport<br>
> bounds.</p>
<p dir="ltr">I'll have to look a little closer but we may be able to do that.</p>
<p dir="ltr">> It's not clear yet whether or not this information gathering will be any useful.</p>
<p dir="ltr">I think everyone agrees that the extension is useful, especially for glamor and the like. At some point we need to just draft something, plumb it through, write Piglit tests, and keep speccing until we can all do it.</p>
<p dir="ltr">--Jason</p>