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

Marek Olšák maraeo at gmail.com
Mon Jan 23 06:44:52 PST 2012


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.

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


More information about the mesa-dev mailing list