summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bo_state.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
index f31772fe1d..7eef8c1ee8 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
@@ -126,13 +126,13 @@ void
nouveau_bo_context_reset(struct nouveau_bo_context *bctx)
{
struct nouveau_bo_state *s = &to_nouveau_context(bctx->ctx)->bo;
- int i;
-
- for (i = 0; i < bctx->count; i++)
- nouveau_bo_ref(NULL, &bctx->marker[i].bo);
+ int i, n = bctx->count;
- s->count -= bctx->count;
+ s->count -= n;
bctx->count = 0;
+
+ for (i = 0; i < n; i++)
+ nouveau_bo_ref(NULL, &bctx->marker[i].bo);
}
GLboolean