aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2007-12-11 13:21:14 -0800
committerEric Anholt <[email protected]>2007-12-12 15:03:15 -0800
commit37406c2038c418a1d6f26b5ac5691586c9f05631 (patch)
treeb0802ac29687be492ee599ddec65195fc143be6f /src/mesa/drivers/dri/common
parent5ad260246bbcd3f40f9f7f64fac82f1fb2aa3efb (diff)
[intel] Assert against conflicting relocation emits in bufmgr_fake.c
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index b9c6bba22aa..5cd96f0821d 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -962,6 +962,7 @@ dri_fake_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
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);
@@ -987,6 +988,17 @@ dri_fake_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
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;
}