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.
This commit is contained in:
@@ -114,6 +114,11 @@ void st_init_limits(struct st_context *st)
|
||||
= _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
|
||||
c->MaxPointSizeAA
|
||||
= _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
|
||||
/* these are not queryable. Note that GL basically mandates a 1.0 minimum
|
||||
* for non-aa sizes, but we can go down to 0.0 for aa points.
|
||||
*/
|
||||
c->MinPointSize = 1.0f;
|
||||
c->MinPointSizeAA = 0.0f;
|
||||
|
||||
c->MaxTextureMaxAnisotropy
|
||||
= _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
|
||||
|
Reference in New Issue
Block a user