On Thu, 10 May 2012 06:56:49 -0700, Paul Berry <stereotype...@gmail.com> wrote: > On 9 May 2012 20:07, Eric Anholt <e...@anholt.net> wrote: > > > On Mon, 7 May 2012 14:32:18 -0700, Paul Berry <stereotype...@gmail.com> > > wrote: > > > +/** > > > + * Generate a set of aub file annotations for the current batch buffer, > > and > > > + * deliver them to DRM. > > > + * > > > + * The "used" section of the batch buffer (the portion containing batch > > > + * commands) is annotated with AUB_TRACE_TYPE_BATCH. The remainder of > > the > > > + * batch buffer (which contains data structures pointed to by batch > > commands) > > > + * is annotated according to the type of each data structure. > > > + */ > > > +void > > > +brw_annotate_aub(struct intel_context *intel) > > > +{ > > > + struct brw_context *brw = brw_context(&intel->ctx); > > > + > > > + unsigned annotation_count = 2 * brw->state_batch_count + 1; > > > + drm_intel_aub_annotation annotations[annotation_count]; > > > + int a = 0; > > > + make_annotation(&annotations[a++], AUB_TRACE_TYPE_BATCH, 0, > > > + 4*intel->batch.used); > > > + for (int i = brw->state_batch_count; i-- > 0; ) { > > > + uint32_t type = brw->state_batch_list[i].type; > > > > Isn't the for loop start here off by one? > > > > I don't think so. Note the postdecrement in the loop condition, so the > first time through the loop i == brw->state_batch_count - 1.
That's clever.
pgpoTQbU2KMWp.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev