[Mesa-dev] [PATCH 1/3] llvmpipe: count c_primitives before discarding null prims

Roland Scheidegger sroland at vmware.com
Thu Sep 19 16:19:03 PDT 2013


Am 19.09.2013 20:43, schrieb Zack Rusin:
> We need to count the clipper primitives before the rasterizer
> discards one it considers to be null.
> 
> Signed-off-by: Zack Rusin <zackr at vmware.com>
> ---
>  src/gallium/drivers/llvmpipe/lp_setup_tri.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
> index 23bc6e2..e61efd4 100644
> --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
> +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
> @@ -252,7 +252,6 @@ do_triangle_ccw(struct lp_setup_context *setup,
>                  const float (*v2)[4],
>                  boolean frontfacing )
>  {
> -   struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup->pipe;
>     struct lp_scene *scene = setup->scene;
>     const struct lp_setup_variant_key *key = &setup->setup.variant->key;
>     struct lp_rast_triangle *tri;
> @@ -340,11 +339,6 @@ do_triangle_ccw(struct lp_setup_context *setup,
>  
>     LP_COUNT(nr_tris);
>  
> -   if (lp_context->active_statistics_queries &&
> -       !llvmpipe_rasterization_disabled(lp_context)) {
> -      lp_context->pipeline_statistics.c_primitives++;
> -   }
> -
>     /* Setup parameter interpolants:
>      */
>     setup->setup.variant->jit_function( v0,
> @@ -803,7 +797,6 @@ static void retry_triangle_ccw( struct lp_setup_context *setup,
>     }
>  }
>  
> -
>  /**
>   * Calculate fixed position data for a triangle
>   */
> @@ -1102,11 +1095,17 @@ static void triangle_both( struct lp_setup_context *setup,
>  			   const float (*v2)[4] )
>  {
>     struct fixed_position position;
> +   struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup->pipe;
>  
>     if (setup->subdivide_large_triangles &&
>         check_subdivide_triangle(setup, v0, v1, v2, triangle_both))
>        return;
>  
> +   if (lp_context->active_statistics_queries &&
> +       !llvmpipe_rasterization_disabled(lp_context)) {
> +      lp_context->pipeline_statistics.c_primitives++;
> +   }
> +
>     calc_fixed_position(setup, &position, v0, v1, v2);
>  
>     if (0) {
> 

Looks good to me. A pity stats will still count them as more than one if
they need subdivision but we can fix that another time.

Roland


More information about the mesa-dev mailing list