static INLINE unsigned
intel_batchbuffer_space(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- return (intel->batch.state_batch_offset - intel->batch.reserved_space)
- - intel->batch.used*4;
+ return (brw->batch.state_batch_offset - brw->batch.reserved_space)
+ - brw->batch.used*4;
}
static INLINE void
intel_batchbuffer_emit_dword(struct brw_context *brw, GLuint dword)
{
- struct intel_context *intel = &brw->intel;
#ifdef DEBUG
assert(intel_batchbuffer_space(brw) >= 4);
#endif
- intel->batch.map[intel->batch.used++] = dword;
+ brw->batch.map[brw->batch.used++] = dword;
}
static INLINE void
static INLINE void
intel_batchbuffer_require_space(struct brw_context *brw, GLuint sz, int is_blit)
{
- struct intel_context *intel = &brw->intel;
- if (intel->gen >= 6 &&
- intel->batch.is_blit != is_blit && intel->batch.used) {
+ if (brw->gen >= 6 &&
+ brw->batch.is_blit != is_blit && brw->batch.used) {
intel_batchbuffer_flush(brw);
}
- intel->batch.is_blit = is_blit;
+ brw->batch.is_blit = is_blit;
#ifdef DEBUG
assert(sz < BATCH_SZ - BATCH_RESERVED);
static INLINE void
intel_batchbuffer_begin(struct brw_context *brw, int n, bool is_blit)
{
- struct intel_context *intel = &brw->intel;
intel_batchbuffer_require_space(brw, n * 4, is_blit);
- intel->batch.emit = intel->batch.used;
+ brw->batch.emit = brw->batch.used;
#ifdef DEBUG
- intel->batch.total = n;
+ brw->batch.total = n;
#endif
}
intel_batchbuffer_advance(struct brw_context *brw)
{
#ifdef DEBUG
- struct intel_context *intel = &brw->intel;
- struct intel_batchbuffer *batch = &intel->batch;
+ struct intel_batchbuffer *batch = &brw->batch;
unsigned int _n = batch->used - batch->emit;
assert(batch->total != 0);
if (_n != batch->total) {
void intel_batchbuffer_cached_advance(struct brw_context *brw);
-/* Here are the crusty old macros, to be removed:
- */
-#define BATCH_LOCALS
-
#define BEGIN_BATCH(n) intel_batchbuffer_begin(brw, n, false)
#define BEGIN_BATCH_BLT(n) intel_batchbuffer_begin(brw, n, true)
#define OUT_BATCH(d) intel_batchbuffer_emit_dword(brw, d)