aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-02-13 09:16:07 -0800
committerEric Anholt <[email protected]>2008-02-13 10:34:48 -0800
commitee8dfa89646ea5aa5e5cf72e29b601cbe357e126 (patch)
tree27b9f53aca131f4429ececbaf5744eb7631cf242 /src/mesa/drivers/dri/common
parente45e33854289222cabb491d4605bf381b1631054 (diff)
Remove O(n^2) debugging code from non-debug path of dri_bufmgr_fake.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr_fake.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
index a6598c1a960..30a4ecb3b75 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c
@@ -899,6 +899,7 @@ static void
dri_fake_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
GLuint offset, dri_bo *target_buf)
{
+ dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)reloc_buf->bufmgr;
struct fake_buffer_reloc *r;
dri_bo_fake *reloc_fake = (dri_bo_fake *)reloc_buf;
int i;
@@ -920,11 +921,13 @@ 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 < reloc_fake->nr_relocs - 1; i++) {
- struct fake_buffer_reloc *r2 = &reloc_fake->relocs[i];
+ if (bufmgr_fake->debug) {
+ /* Check that a conflicting relocation hasn't already been emitted. */
+ for (i = 0; i < reloc_fake->nr_relocs - 1; i++) {
+ struct fake_buffer_reloc *r2 = &reloc_fake->relocs[i];
- assert(r->offset != r2->offset);
+ assert(r->offset != r2->offset);
+ }
}
return;