[Mesa-dev] Revert "gallium: add point size clamp to implementation limits in vertex shader"

Christoph Bumiller e0425955 at student.tuwien.ac.at
Mon Jan 23 07:08:37 PST 2012


On 01/23/2012 03:44 PM, Marek Olšák wrote:
> Hi,
> 
> I will have to (at least partially) revert this commit, as well as the
> forked code in glsl_to_tgsi:
> 
>> commit 2c326e72664e65166c68b027b26aaf373f3be36d
>> Author: Roland Scheidegger <sroland at vmware.com>
>> Date:   Thu Feb 4 19:23:09 2010 +0100
>>
>>     gallium: add point size clamp to implementation limits in vertex shader
>>
>>     The point size min/max registers (unused by mesa state tracker) were removed
>>     since most hardware couldn't do much with them. However, we don't want to have
>>     to rely on hw to do point size clamping correctly to implementation
>>     dependent limits, hence have to do that in the vertex shader. This should also
>>     solve a potential problem with (non-AA) points smaller than 1.0 which according
>>     to OGL still have size 1.0.
>>     Note that OGL point rendering is odd, in particular point sprites are rasterized
>>     differently to points. Some hardware might support those different modes, but in
>>     any case the different clamping values used for smooth/multisampled/sprite
>>     enabled points might help a bit for hw which rasterizes points the same as point
>>     sprites.
>>     Also tweak mesa's ff to vertex shader translation so don't have to clamp twice in
>>     case of point attenuation.
> 
> I mean the part which rewrites vertex shaders to clamp the point size
> in st/mesa. We can't do that if transform feedback is enabled. The
> point size must be unmodified when writing it into a transform
> feedback buffer. Also it's unclear to me why we clamp the point size
> at all.
> 

I think fixed function point rendering (where transform feedback does
not apply) would require clamping since it adheres to glPointParameter,
but GLSL shaders' writes to gl_PointSize should not be clamped, ever.

It looks like nv50 will render arbitrarily large points, but the smooth
ones start looking really weird once you go over a certain threshold
(observed with the binary driver, which doesn't do any clamping).

> If we want to do any clamping, we should do it after transform
> feedback, that is after the vertex and geometry shaders. Hardware
> drivers would have to do it in hardware somehow or fallback to Draw.
> BTW all Radeons can do point size clamping, so adding
> pipe_context::set_point_size_range(float min, float max) would be okay
> for them.
> 
> BTW I think the only operation which can be done before transform
> feedback is vertex color clamping (as per the EXT_transform_feedback
> spec).
> 
> Marek
> _______________________________________________
> 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