Mesa (master): i965: When gl_PointSize is unwritten, default to 1.0 on Gen4-5.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Jun 14 23:25:20 UTC 2017


Module: Mesa
Branch: master
Commit: 6d4e031d9ad7e34d71c8d72afa50d1253515a670
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d4e031d9ad7e34d71c8d72afa50d1253515a670

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed May 10 02:07:46 2017 -0700

i965: When gl_PointSize is unwritten, default to 1.0 on Gen4-5.

Modern GL specifications say that the point size should be 1.0 when
gl_PointSize is unwritten and the last enabled stage is a geometry
or tessellation shader.  If it's a vertex shader, though, both the
GL specs and ES 3.0 spec say that it's undefined - so since Gen4-5
only support vertex shaders, there's no actual requirement to do this.

Since there is a cost associated (an extra dirty bit, which may cause
SF_STATE to be emitted more often), it may not be a good idea.

The real benefit is that it makes all generations behave identically.
And that seems somewhat nice...

Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>

---

 src/mesa/drivers/dri/i965/brw_sf_state.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c
index c4dec44090..69a6d6befe 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_state.c
@@ -168,9 +168,8 @@ static void upload_sf_unit( struct brw_context *brw )
    point_sz = CLAMP(point_sz, 0.125f, 255.875f);
    sf->sf7.point_size = U_FIXED(point_sz, 3);
 
-   /* _NEW_PROGRAM | _NEW_POINT */
-   sf->sf7.use_point_size_state = !(ctx->VertexProgram.PointSizeEnabled ||
-				    ctx->Point._Attenuated);
+   /* _NEW_PROGRAM | _NEW_POINT, BRW_NEW_VUE_MAP_GEOM_OUT */
+   sf->sf7.use_point_size_state = use_state_point_size(brw);
    sf->sf7.aa_line_distance_mode = brw->is_g4x || brw->gen == 5;
 
    /* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons:
@@ -221,6 +220,7 @@ const struct brw_tracked_state brw_sf_unit = {
                BRW_NEW_PROGRAM_CACHE |
                BRW_NEW_SF_PROG_DATA |
                BRW_NEW_SF_VP |
+               BRW_NEW_VUE_MAP_GEOM_OUT |
                BRW_NEW_URB_FENCE,
    },
    .emit = upload_sf_unit,




More information about the mesa-commit mailing list