Am 10.06.2013 16:31, schrieb Zack Rusin: > We need to figure out the number of invocations of the clipper > before the emit, because in the emit we are after clipping > where the number of primitives will be equal to number of clipper > invocations minus the clipped primitives. So our computations > were always off by the number of clipped primitives. > > Signed-off-by: Zack Rusin <za...@vmware.com> > --- > src/gallium/auxiliary/draw/draw_pt_emit.c | 6 ------ > .../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 14 > ++++++++++++++ > .../auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c | 13 +++++++++++++ > 3 files changed, 27 insertions(+), 6 deletions(-) > > diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c > b/src/gallium/auxiliary/draw/draw_pt_emit.c > index b3d3546..ea02554 100644 > --- a/src/gallium/auxiliary/draw/draw_pt_emit.c > +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c > @@ -180,12 +180,6 @@ draw_pt_emit(struct pt_emit *emit, > i < prim_info->primitive_count; > start += prim_info->primitive_lengths[i], i++) > { > - if (draw->collect_statistics) { > - draw->statistics.c_invocations += > - u_decomposed_prims_for_vertices(prim_info->prim, > - prim_info->primitive_lengths[i]); > - } > - > render->draw_elements(render, > elts + start, > prim_info->primitive_lengths[i]); > diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c > b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c > index 6d1bd11..bd27dea 100644 > --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c > +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c > @@ -317,6 +317,20 @@ static void fetch_pipeline_generic( struct > draw_pt_middle_end *middle, > */ > draw_pt_so_emit( fpme->so_emit, vert_info, prim_info ); > > + /* We need to figure out how many prmitivies we would have primitives
> + * sent to the clipper */ > + if (draw->collect_statistics) { > + unsigned start, i; > + for (start = i = 0; > + i < prim_info->primitive_count; > + start += prim_info->primitive_lengths[i], i++) > + { > + draw->statistics.c_invocations += > + u_decomposed_prims_for_vertices(prim_info->prim, > + prim_info->primitive_lengths[i]); > + } > + } > + > /* > * if there's no position, need to stop now, or the latter stages > * will try to access non-existent position output. > diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c > b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c > index ecb7a6b..da5e68e 100644 > --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c > +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c > @@ -411,6 +411,19 @@ llvm_pipeline_generic( struct draw_pt_middle_end *middle, > /* stream output needs to be done before clipping */ > draw_pt_so_emit( fpme->so_emit, vert_info, prim_info ); > > + /* We need to figure out how many prmitivies we would have primitives > + * sent to the clipper */ > + if (draw->collect_statistics) { > + unsigned start, i; > + for (start = i = 0; > + i < prim_info->primitive_count; > + start += prim_info->primitive_lengths[i], i++) > + { > + draw->statistics.c_invocations += > + u_decomposed_prims_for_vertices(prim_info->prim, > + prim_info->primitive_lengths[i]); > + } > + } > /* > * if there's no position, need to stop now, or the latter stages > * will try to access non-existent position output. > Looks good to me. Roland _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev