diff options
author | Keith Whitwell <[email protected]> | 2008-01-10 14:57:55 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-01-25 15:50:05 +0000 |
commit | 7a207682aafc05c62cbc5851cc6c98c43aa3d9bd (patch) | |
tree | 5221e1d9b69f0c3e1de150ced729c7e6a64a5cc6 /src/mesa/pipe/i965simple | |
parent | 59d66bf9df3a6b964f177a8aff286cac63476add (diff) |
965: add asserts to catch batch overrun
Diffstat (limited to 'src/mesa/pipe/i965simple')
-rw-r--r-- | src/mesa/pipe/i965simple/brw_batch.h | 3 | ||||
-rw-r--r-- | src/mesa/pipe/i965simple/brw_winsys.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/pipe/i965simple/brw_batch.h b/src/mesa/pipe/i965simple/brw_batch.h index 8605d7c1083..5f5932a4883 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 253599896ca..b60f63aa5bf 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 |