From 7a207682aafc05c62cbc5851cc6c98c43aa3d9bd Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 10 Jan 2008 14:57:55 +0000 Subject: 965: add asserts to catch batch overrun --- src/mesa/pipe/i965simple/brw_batch.h | 3 ++- src/mesa/pipe/i965simple/brw_winsys.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa/pipe/i965simple') diff --git a/src/mesa/pipe/i965simple/brw_batch.h b/src/mesa/pipe/i965simple/brw_batch.h index 8605d7c108..5f5932a488 100644 --- a/src/mesa/pipe/i965simple/brw_batch.h +++ b/src/mesa/pipe/i965simple/brw_batch.h @@ -44,7 +44,8 @@ #define OUT_RELOC( buf, flags, delta ) \ brw->winsys->batch_reloc(brw->winsys, buf, flags, delta) -#define ADVANCE_BATCH() +#define ADVANCE_BATCH() \ + brw->winsys->batch_end( brw->winsys ) /* XXX: this is bogus - need proper handling for out-of-memory in batchbuffer. */ diff --git a/src/mesa/pipe/i965simple/brw_winsys.h b/src/mesa/pipe/i965simple/brw_winsys.h index 253599896c..b60f63aa5b 100644 --- a/src/mesa/pipe/i965simple/brw_winsys.h +++ b/src/mesa/pipe/i965simple/brw_winsys.h @@ -193,9 +193,13 @@ static inline boolean brw_batchbuffer_data(struct brw_winsys *winsys, uint i; const unsigned *udata = (const unsigned*)(data); unsigned size = bytes/incr; + + winsys->batch_start(winsys, size, 0); for (i = 0; i < size; ++i) { winsys->batch_dword(winsys, udata[i]); } + winsys->batch_end(winsys); + return (i == size); } #endif -- cgit v1.2.3