struct fake_buffer_reloc *r = &bufmgr_fake->reloc[bufmgr_fake->nr_relocs++];
dri_bo_fake *target_fake = (dri_bo_fake *)target_buf;
dri_bo_fake *reloc_fake = (dri_bo_fake *)reloc_buf;
+ int i;
assert(bufmgr_fake->nr_relocs <= MAX_RELOCS);
r->delta = delta;
r->validate_flags = flags;
+ /* Check that a conflicting relocation hasn't already been emitted. */
+ for (i = 0; i < bufmgr_fake->nr_relocs - 1; i++) {
+ struct fake_buffer_reloc *r2 = &bufmgr_fake->reloc[i];
+
+ assert(r->reloc_buf != r2->reloc_buf ||
+ r->offset != r2->offset ||
+ (r->target_buf == r2->target_buf &&
+ r->delta == r2->delta &&
+ r->validate_flags == r2->validate_flags));
+ }
+
return;
}