<div class="gmail_quote">On Wed, Aug 25, 2010 at 3:43 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>></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>
> keith whitwell wrote:<br>
>> The point state is complex, there are actually a lot of variations<br>
>> built into GL itself which aren't obvious on first reading of the<br>
>> spec. Probably the most obscure is that wide points and point sprites<br>
>> are specified to actually be rasterized differently, ie color<br>
>> different pixels. I'm doing this from memory, but Roland dug into it<br>
>> in depth. Wide points have an explicit set of rules for which pixels<br>
>> they cover, but point sprites are to be rasterized with the same rules<br>
>> as a quad of similar size (again from memory). The docs do explain<br>
>> it, but it's complex none the less, and I do still wonder if there is<br>
>> a clear way of capturing all the variations.<br>
><br>
> I remember a lot of back and forth when we crafted the rasterization<br>
> rules for point sprites. I believe the intention was that<br>
> implementations could either decompose a point sprite into a quad / two<br>
> triangles or reuse the existing wide point rasterization hardware. At<br>
> 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'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'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'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't know if there'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't hurt), and I don't<br>
quite understand what that "| 1" part is supposed to do, looks wrong to me.<br></blockquote><div><br>It'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'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>