[Mesa-dev] [PATCH] i965: Account for TES in is_drawing_points().

Iago Toral itoral at igalia.com
Fri Mar 18 08:33:49 UTC 2016


On Tue, 2016-03-15 at 12:07 -0700, Kenneth Graunke wrote:
> Now that we implement tessellation shaders, the TES might be the last
> stage enabled.  If it's outputting points, then the primitive type
> reaching the SF is points.  We need to account for this.
> 
> Caught by Ilia Mirkin.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/gen6_sf_state.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> index 2634e6b..374955a 100644
> --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c
> +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c
> @@ -160,6 +160,10 @@ is_drawing_points(const struct brw_context *brw)
>     if (brw->geometry_program) {
>        /* BRW_NEW_GEOMETRY_PROGRAM */
>        return brw->geometry_program->OutputType == GL_POINTS;
> +   } else if (brw->tes.prog_data) {
> +      /* BRW_NEW_TES_PROG_DATA */
> +      return brw->tes.prog_data->output_topology ==
> +             BRW_TESS_OUTPUT_TOPOLOGY_POINT;
>     } else {
>        /* BRW_NEW_PRIMITIVE */
>        return brw->primitive == _3DPRIM_POINTLIST;
> @@ -484,6 +488,7 @@ const struct brw_tracked_state gen6_sf_state = {
>                 BRW_NEW_FS_PROG_DATA |
>                 BRW_NEW_GEOMETRY_PROGRAM |
>                 BRW_NEW_PRIMITIVE |
> +               BRW_NEW_TES_PROG_DATA |
>                 BRW_NEW_VUE_MAP_GEOM_OUT,
>     },
>     .emit = upload_sf_state,

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

Not that it matters much I guess but there are a few references in this
file to the dirty state flags and stages involved in certain things.
Specifically the place where we call is_drawing_points() mentions
BRW_NEW_GEOMETRY_PROGRAM but not BRW_NEW_TES_PROG_DATA and
calculate_attr_overrides() talks about VS/GS but not TESS, so we might
want to update some of these comments too.

Iago



More information about the mesa-dev mailing list