diff options
Diffstat (limited to 'src/intel_batchbuffer.h')
-rw-r--r-- | src/intel_batchbuffer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/intel_batchbuffer.h b/src/intel_batchbuffer.h index bf7a5d90..5863561d 100644 --- a/src/intel_batchbuffer.h +++ b/src/intel_batchbuffer.h @@ -63,7 +63,9 @@ static inline void intel_batch_start_atomic(ScrnInfoPtr scrn, unsigned int sz) intel_screen_private *intel = intel_get_screen_private(scrn); assert(!intel->in_batch_atomic); + intel_batch_require_space(scrn, intel, sz * 4); + intel->current_batch = RENDER_BATCH; \ intel->in_batch_atomic = TRUE; intel->batch_atomic_limit = intel->batch_used + sz; @@ -173,17 +175,23 @@ union intfloat { OUT_BATCH(tmp.ui); \ } while(0) -#define BEGIN_BATCH(n) \ +#define __BEGIN_BATCH(n,batch_idx) \ do { \ if (intel->batch_emitting != 0) \ FatalError("%s: BEGIN_BATCH called without closing " \ "ADVANCE_BATCH\n", __FUNCTION__); \ assert(!intel->in_batch_atomic); \ + if (intel->current_batch != batch_idx) \ + intel_batch_submit(scrn, FALSE); \ intel_batch_require_space(scrn, intel, (n) * 4); \ + intel->current_batch = batch_idx; \ intel->batch_emitting = (n); \ intel->batch_emit_start = intel->batch_used; \ } while (0) +#define BEGIN_BATCH(n) __BEGIN_BATCH(n,RENDER_BATCH) +#define BEGIN_BATCH_BLT(n) __BEGIN_BATCH(n,BLT_BATCH) + #define ADVANCE_BATCH() do { \ if (intel->batch_emitting == 0) \ FatalError("%s: ADVANCE_BATCH called with no matching " \ |