From cfaaf6af777ad8e56da5a077bdc01f4f2d7bc4d6 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Mon, 29 Dec 2008 21:17:44 +0800 Subject: [PATCH] Don't count vertex buffer in second aperture size check With batch flush notify vertex buffer will be unreferenced, so don't count it in later aperture check. Also adding uninitialized vertex buffer check in batch flush notify. --- src/i965_render.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/i965_render.c b/src/i965_render.c index df3814f5..3b0ee35d 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -1015,11 +1015,8 @@ _emit_batch_header_for_composite_internal (ScrnInfoPtr pScrn, Bool check_twice) /* If the command still won't fit in an empty batch, then it's * just plain too big for the hardware---fallback to software. */ - if (dri_bufmgr_check_aperture_space (bo_table, NUM_BO) < 0) { - dri_bo_unreference (render_state->vertex_buffer_bo); - render_state->vertex_buffer_bo = NULL; + if (dri_bufmgr_check_aperture_space (bo_table, 1) < 0) return FALSE; - } } } @@ -1588,8 +1585,10 @@ i965_batch_flush_notify(ScrnInfoPtr pScrn) /* Once a batch is emitted, we never want to map again any buffer * object being referenced by that batch, (which would be very * expensive). */ - dri_bo_unreference (render_state->vertex_buffer_bo); - render_state->vertex_buffer_bo = NULL; + if (render_state->vertex_buffer_bo) { + dri_bo_unreference (render_state->vertex_buffer_bo); + render_state->vertex_buffer_bo = NULL; + } } /**