summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2008-12-29 21:17:44 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-12-29 21:17:44 +0800
commitcfaaf6af777ad8e56da5a077bdc01f4f2d7bc4d6 (patch)
treeb3c88ade0d57dc209523c37112695442b8a4f444
parentb710a688a7383df320f9d4e765b48331310a4d1d (diff)
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.
-rw-r--r--src/i965_render.c11
1 files 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;
+ }
}
/**