summaryrefslogtreecommitdiff
path: root/src
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-30 18:09:49 +0800
commit94a77b62510d8db5cd21ef40b8d03a36cd0c0af2 (patch)
tree77383fa5f4843205d7dd38cba71b00f42250dc01 /src
parent1b897abd6c8500dc6dcaac548ab7d531f37522c8 (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. (cherry picked from commit cfaaf6af777ad8e56da5a077bdc01f4f2d7bc4d6)
Diffstat (limited to 'src')
-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;
+ }
}
/**