/* There's definitely nothing in the VCD cache we want. */
cl_emit(&job->bcl, FLUSH_VCD_CACHE, bin);
+ /* Disable any leftover OQ state from another job. */
+ cl_emit(&job->bcl, OCCLUSION_QUERY_COUNTER, counter);
+
/* "Binning mode lists must have a Start Tile Binning item (6) after
* any prefix state data before the binning list proper starts."
*/
job->shader_rec_count++;
}
+/**
+ * Computes the various transform feedback statistics, since they can't be
+ * recorded by CL packets.
+ */
+static void
+vc5_tf_statistics_record(struct vc5_context *vc5,
+ const struct pipe_draw_info *info,
+ bool prim_tf)
+{
+ uint32_t prims = u_prims_for_vertices(info->mode, info->count);
+
+ vc5->prims_generated += prims;
+
+ if (prim_tf) {
+ /* XXX: Only count if we didn't overflow. */
+ vc5->tf_prims_generated += prims;
+ }
+}
+
static void
vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
{
* flag set.
*/
uint32_t prim_tf_enable = 0;
- if (vc5->prog.bind_vs->num_tf_outputs)
+ if (vc5->streamout.num_targets)
prim_tf_enable = (V3D_PRIM_POINTS_TF - V3D_PRIM_POINTS);
+ vc5_tf_statistics_record(vc5, info, prim_tf_enable);
+
/* Note that the primitive type fields match with OpenGL/gallium
* definitions, up to but not including QUADS.
*/
vc5_job_add_bo(job, rsc->bo);
}
+ if (job->referenced_size > 768 * 1024 * 1024) {
+ perf_debug("Flushing job with %dkb to try to free up memory\n",
+ job->referenced_size / 1024);
+ vc5_flush(pctx);
+ }
+
if (V3D_DEBUG & V3D_DEBUG_ALWAYS_FLUSH)
vc5_flush(pctx);
}
union util_color uc;
uint32_t internal_size = 4 << surf->internal_bpp;
+ static union pipe_color_union swapped_color;
+ if (vc5->swap_color_rb & (1 << i)) {
+ swapped_color.f[0] = color->f[2];
+ swapped_color.f[1] = color->f[1];
+ swapped_color.f[2] = color->f[0];
+ swapped_color.f[3] = color->f[3];
+ color = &swapped_color;
+ }
+
switch (surf->internal_type) {
case INTERNAL_TYPE_8:
if (surf->format == PIPE_FORMAT_B4G4R4A4_UNORM ||