#include "util/u_cpu_detect.h"
#include "util/u_inlines.h"
#include "util/u_helpers.h"
+#include "util/u_prim.h"
#include "draw_context.h"
#include "draw_vs.h"
#include "draw_gs.h"
{
draw->collect_statistics = enable;
}
+
+/**
+ * Computes clipper invocation statistics.
+ *
+ * Figures out how many primitives would have been
+ * sent to the clipper given the specified
+ * prim info data.
+ */
+void
+draw_stats_clipper_primitives(struct draw_context *draw,
+ const struct draw_prim_info *prim_info)
+{
+ 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]);
+ }
+ }
+}
boolean scissor,
boolean flatshade );
+void
+draw_stats_clipper_primitives(struct draw_context *draw,
+ const struct draw_prim_info *prim_info);
+
/**
* Return index i from the index buffer.
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]);
*/
draw_pt_so_emit( fpme->so_emit, vert_info, prim_info );
+ draw_stats_clipper_primitives(draw, prim_info);
+
/*
* if there's no position, need to stop now, or the latter stages
* will try to access non-existent position output.
/* stream output needs to be done before clipping */
draw_pt_so_emit( fpme->so_emit, vert_info, prim_info );
+ draw_stats_clipper_primitives(draw, prim_info);
+
/*
* if there's no position, need to stop now, or the latter stages
* will try to access non-existent position output.