summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/i915simple/i915_prim_vbuf.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2007-11-03 01:31:47 +0000
committerJosé Fonseca <[email protected]>2007-11-03 02:01:32 +0000
commit5fa6ea68586e906a984291dd4c20f664924157eb (patch)
tree1d0f22c5e99e7891447847109249cc5c611e73af /src/mesa/pipe/i915simple/i915_prim_vbuf.c
parent5c1606a2b3e951c32f028e0b328e6c06e9424e28 (diff)
Do something sensible when failed to reserve space in the batch buffer.
Diffstat (limited to 'src/mesa/pipe/i915simple/i915_prim_vbuf.c')
-rw-r--r--src/mesa/pipe/i915simple/i915_prim_vbuf.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mesa/pipe/i915simple/i915_prim_vbuf.c b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
index 6f497879ad9..3632adce790 100644
--- a/src/mesa/pipe/i915simple/i915_prim_vbuf.c
+++ b/src/mesa/pipe/i915simple/i915_prim_vbuf.c
@@ -303,12 +303,7 @@ static void vbuf_draw( struct draw_stage *stage )
if (i915->hardware_dirty)
i915_emit_hardware_state( i915 );
- ptr = BEGIN_BATCH( 4 + (nr + 1)/2, 1 );
-#if 1
- assert(ptr);
-#else
- /* XXX: below is bogus as ptr always nonzero except in fatal errors */
- if (ptr == 0) {
+ if (!BEGIN_BATCH( 4 + (nr + 1)/2, 1 )) {
FLUSH_BATCH();
/* Make sure state is re-emitted after a flush:
@@ -316,13 +311,11 @@ static void vbuf_draw( struct draw_stage *stage )
i915_update_derived( i915 );
i915_emit_hardware_state( i915 );
- ptr = BEGIN_BATCH( 2, 1 );
- if (ptr == 0) {
+ if (!BEGIN_BATCH( 4 + (nr + 1)/2, 1 )) {
assert(0);
return;
}
}
-#endif
/* FIXME: don't do this every time */
OUT_BATCH( _3DSTATE_LOAD_STATE_IMMEDIATE_1 |