[Mesa-stable] [PATCH 2/2] i965: Fix point size with tessellation/geometry shaders.

Kenneth Graunke kenneth at whitecape.org
Thu Jun 2 04:25:59 UTC 2016


I believe we were using the state-based point size when either the
tessellation evaluation or geometry shader, but the vertex shader
didn't write it.  If the last enabled stage writes it (corresponding
to brw_vue_map_geom_out), we should use the shader's value, otherwise
state.  This should handle the Attenuated case as well, as the
fixed-function shader will also write it.

Fixes a number of dEQP tests with EXT_tessellation_shader enabled:
dEQP-GLES31.functional.tessellation_geometry_interaction.point_size.*

Cc: "12.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/gen6_sf_state.c | 5 ++---
 src/mesa/drivers/dri/i965/gen7_sf_state.c | 8 ++++----
 src/mesa/drivers/dri/i965/gen8_sf_state.c | 8 ++++----
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
index 0538ab7..f35926e 100644
--- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
@@ -373,9 +373,8 @@ upload_sf_state(struct brw_context *brw)
    if (multisampled_fbo && ctx->Multisample.Enabled)
       dw3 |= GEN6_SF_MSRAST_ON_PATTERN;
 
-   /* _NEW_PROGRAM | _NEW_POINT */
-   if (!(ctx->VertexProgram.PointSizeEnabled ||
-	 ctx->Point._Attenuated))
+   /* BRW_NEW_VUE_MAP_GEOM_OUT */
+   if ((brw->vue_map_geom_out.slots_valid & VARYING_BIT_PSIZ) == 0)
       dw4 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
    /* _NEW_POINT - Clamp to ARB_point_parameters user limits */
diff --git a/src/mesa/drivers/dri/i965/gen7_sf_state.c b/src/mesa/drivers/dri/i965/gen7_sf_state.c
index d3a658c..7957614 100644
--- a/src/mesa/drivers/dri/i965/gen7_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sf_state.c
@@ -213,8 +213,8 @@ upload_sf_state(struct brw_context *brw)
 
    dw3 = GEN6_SF_LINE_AA_MODE_TRUE;
 
-   /* _NEW_PROGRAM | _NEW_POINT */
-   if (!(ctx->VertexProgram.PointSizeEnabled || ctx->Point._Attenuated))
+   /* BRW_NEW_VUE_MAP_GEOM_OUT */
+   if ((brw->vue_map_geom_out.slots_valid & VARYING_BIT_PSIZ) == 0)
       dw3 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
    /* _NEW_POINT - Clamp to ARB_point_parameters user limits */
@@ -252,11 +252,11 @@ const struct brw_tracked_state gen7_sf_state = {
                _NEW_MULTISAMPLE |
                _NEW_POINT |
                _NEW_POLYGON |
-               _NEW_PROGRAM |
                _NEW_SCISSOR,
       .brw   = BRW_NEW_BLORP |
                BRW_NEW_CONTEXT |
-               BRW_NEW_PRIMITIVE,
+               BRW_NEW_PRIMITIVE |
+               BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = upload_sf_state,
 };
diff --git a/src/mesa/drivers/dri/i965/gen8_sf_state.c b/src/mesa/drivers/dri/i965/gen8_sf_state.c
index d854b6d..b22a5f0 100644
--- a/src/mesa/drivers/dri/i965/gen8_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_sf_state.c
@@ -172,8 +172,8 @@ upload_sf(struct brw_context *brw)
    /* Clamp to the hardware limits and convert to fixed point */
    dw3 |= U_FIXED(CLAMP(point_size, 0.125f, 255.875f), 3);
 
-   /* _NEW_PROGRAM | _NEW_POINT */
-   if (!(ctx->VertexProgram.PointSizeEnabled || ctx->Point._Attenuated))
+   /* BRW_NEW_VUE_MAP_GEOM_OUT */
+   if ((brw->vue_map_geom_out.slots_valid & VARYING_BIT_PSIZ) == 0)
       dw3 |= GEN6_SF_USE_STATE_POINT_WIDTH;
 
    /* _NEW_POINT | _NEW_MULTISAMPLE */
@@ -204,12 +204,12 @@ upload_sf(struct brw_context *brw)
 const struct brw_tracked_state gen8_sf_state = {
    .dirty = {
       .mesa  = _NEW_LIGHT |
-               _NEW_PROGRAM |
                _NEW_LINE |
                _NEW_MULTISAMPLE |
                _NEW_POINT,
       .brw   = BRW_NEW_BLORP |
-               BRW_NEW_CONTEXT,
+               BRW_NEW_CONTEXT |
+               BRW_NEW_VUE_MAP_GEOM_OUT,
    },
    .emit = upload_sf,
 };
-- 
2.8.3



More information about the mesa-stable mailing list