<div class="gmail_quote">On Wed, Aug 25, 2010 at 3:43 PM, Roland Scheidegger <span dir="ltr">&lt;<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">On 25.08.2010 09:05, Ian Romanick wrote:<br>
&gt; keith whitwell wrote:<br>
&gt;&gt; The point state is complex, there are actually a lot of variations<br>
&gt;&gt; built into GL itself which aren&#39;t obvious on first reading of the<br>
&gt;&gt; spec.  Probably the most obscure is that wide points and point sprites<br>
&gt;&gt; are specified to actually be rasterized differently, ie color<br>
&gt;&gt; different pixels.  I&#39;m doing this from memory, but Roland dug into it<br>
&gt;&gt; in depth.  Wide points have an explicit set of rules for which pixels<br>
&gt;&gt; they cover, but point sprites are to be rasterized with the same rules<br>
&gt;&gt; as a quad of similar size (again from memory).  The docs do explain<br>
&gt;&gt; it, but it&#39;s complex none the less, and I do still wonder if there is<br>
&gt;&gt; a clear way of capturing all the variations.<br>
&gt;<br>
&gt; I remember a lot of back and forth when we crafted the rasterization<br>
&gt; rules for point sprites.  I believe the intention was that<br>
&gt; implementations could either decompose a point sprite into a quad / two<br>
&gt; triangles or reuse the existing wide point rasterization hardware.  At<br>
&gt; the end of the day, it is a big mess and a pain in the behind.<br>
<br>
</div>Yes, indeed - new GL tossed out traditional point rendering (i.e. point<br>
sprite mode is always active, point rendering similar to what d3d uses).<br>
It didn&#39;t look to me though that you could use either quad rendering or<br>
some point implementation using point rendering rules and be compliant<br>
with both gl modes, at the very least there&#39;s a difference for<br>
zero-sized points (which will disappear with the quad approach but be<br>
one pixel with the point rendering approach - that is something however<br>
which might be fixed with the min clamp adjustment).<br>
So if drivers can&#39;t switch point rendering rules, they probably just<br>
need to ignore point_quad_rasterization (it is illegal for point quad<br>
rasterization to be false but one of the sprite_coord_enable bits set).<br></blockquote><div><br>On r300, points are always rasterized as parallelograms or, as you say, quads (can be non-square). I cannot disable quad rasterization, but I can use point size clamping.<br>

<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
sprite_coord_enable though is per-coord (as per legacy GL, not in d3d or<br>
GL3) and should be honored accordingly, though I don&#39;t know if there&#39;s<br>
really something out there which uses, say, 2 textures on a point<br>
sprite, one with interpolated texture coords the other with single coord<br>
for the whole point...<br></blockquote><div><br>sprite_coord_enable matches r300 hw exactly (there are per-texcoord enable bits in hw).<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


So regarding the r300g code, it could possibly ignore<br>
point_quad_rasterization (but honoring it shouldn&#39;t hurt), and I don&#39;t<br>
quite understand what that &quot;| 1&quot; part is supposed to do, looks wrong to me.<br></blockquote><div><br>It&#39;s for gl_PointCoord. It means:<br><br>if (point_quad_rasterization)<br>   sprite_coord_enable |= 1;<br>

else<br>   sprite_coord_enable = 0;<br><br>The problem is that if a shader uses gl_PointCoord, st/mesa doesn&#39;t set sprite_coord_enable to a non-zero value to actually enable the sprite coords, so I enforce this in the driver (like nvfx does), assuming gl_PointCoord occupies GENERIC0.<br>

<br>Marek<br></div></div>