// __FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
- BEGIN_BATCH(6, 1);
+ if (!BEGIN_BATCH(6, 1)) {
+ FLUSH_BATCH();
+ assert(BEGIN_BATCH(6, 1));
+ }
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((y << 16) | x);
assert (dst_pitch > 0 && src_pitch > 0);
- BEGIN_BATCH(8, 2);
+ if (!BEGIN_BATCH(8, 2)) {
+ FLUSH_BATCH();
+ assert(BEGIN_BATCH(8, 2));
+ }
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((dst_y << 16) | dst_x);
if (flags & PIPE_FLUSH_TEXTURE_CACHE)
flush |= FLUSH_MAP_CACHE;
- BEGIN_BATCH( 1, 0 );
+ if (!BEGIN_BATCH(1, 0)) {
+ FLUSH_BATCH();
+ assert(BEGIN_BATCH(1, 0));
+ }
OUT_BATCH( flush );
ADVANCE_BATCH();
}
{
struct i915_context *i915 = setup_stage(stage)->i915;
unsigned vertex_size = i915->current.vertex_info.size * 4; /* in bytes */
- unsigned *ptr;
unsigned i;
assert(vertex_size >= 12); /* never smaller than 12 bytes */
if (i915->hardware_dirty)
i915_emit_hardware_state( i915 );
- ptr = BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 );
- if (ptr == 0) {
+ if (!BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 )) {
FLUSH_BATCH();
/* Make sure state is re-emitted after a flush:
i915_update_derived( i915 );
i915_emit_hardware_state( i915 );
- ptr = BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 );
- if (ptr == 0) {
+ if (!BEGIN_BATCH( 1 + nr * vertex_size / 4, 0 )) {
assert(0);
return;
}
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:
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 |
if(!BEGIN_BATCH(dwords, relocs)) {
FLUSH_BATCH();
- BEGIN_BATCH(dwords, relocs);
+ assert(BEGIN_BATCH(dwords, relocs));
}
/* 14 dwords, 0 relocs */