#include "util/half_float.h"
#include "util/u_helpers.h"
#include "util/u_format.h"
+#include "util/u_prim.h"
#include "util/u_prim_restart.h"
#include "indices/u_primconvert.h"
#include "tgsi/tgsi_parse.h"
/* XXX */
ctx->dirty |= PAN_DIRTY_SAMPLERS | PAN_DIRTY_TEXTURES;
+
+ /* TODO: When does this need to be handled? */
+ ctx->active_queries = true;
}
/* In practice, every field of these payloads should be configurable
return (ss->minx == ss->maxx) || (ss->miny == ss->maxy);
}
+/* Count generated primitives (when there is no geom/tess shaders) for
+ * transform feedback */
+
+static void
+panfrost_statistics_record(
+ struct panfrost_context *ctx,
+ const struct pipe_draw_info *info)
+{
+ if (!ctx->active_queries)
+ return;
+
+ uint32_t prims = u_prims_for_vertices(info->mode, info->count);
+ ctx->prims_generated += prims;
+
+ if (ctx->streamout.num_targets <= 0)
+ return;
+
+ ctx->tf_prims_generated += prims;
+}
+
static void
panfrost_draw_vbo(
struct pipe_context *pipe,
draw_flags |= 0x800;
}
+ panfrost_statistics_record(ctx, info);
+
if (info->index_size) {
/* Calculate the min/max index used so we can figure out how
* many times to invoke the vertex shader */