3 * called from intel_batchbuffer_flush and children before sending a
6 static void brw_finish_batch(struct intel_context
*intel
)
8 struct brw_context
*brw
= brw_context(&intel
->ctx
);
9 brw_emit_query_end(brw
);
14 * called from intelFlushBatchLocked
16 static void brw_new_batch( struct brw_context
*brw
)
18 /* Check that we didn't just wrap our batchbuffer at a bad time. */
19 assert(!brw
->no_batch_wrap
);
21 brw
->curbe
.need_new_bo
= GL_TRUE
;
23 /* Mark all context state as needing to be re-emitted.
24 * This is probably not as severe as on 915, since almost all of our state
25 * is just in referenced buffers.
27 brw
->state
.dirty
.brw
|= BRW_NEW_CONTEXT
;
29 brw
->state
.dirty
.mesa
|= ~0;
30 brw
->state
.dirty
.brw
|= ~0;
31 brw
->state
.dirty
.cache
|= ~0;
33 /* Move to the end of the current upload buffer so that we'll force choosing
34 * a new buffer next time.
36 if (brw
->vb
.upload
.bo
!= NULL
) {
37 brw
->sws
->bo_unreference(brw
->vb
.upload
.bo
);
38 brw
->vb
.upload
.bo
= NULL
;
39 brw
->vb
.upload
.offset
= 0;
44 static void brw_note_fence( struct brw_context
*brw
, GLuint fence
)
46 brw_context(&intel
->ctx
)->state
.dirty
.brw
|= BRW_NEW_FENCE
;
49 /* called from intelWaitForIdle() and intelFlush()
51 * For now, just flush everything. Could be smarter later.
53 static GLuint
brw_flush_cmd( void )
55 struct brw_mi_flush flush
;
56 flush
.opcode
= CMD_MI_FLUSH
;
58 flush
.flags
= BRW_FLUSH_STATE_CACHE
;
59 return *(GLuint
*)&flush
;