i965g: hook up more pipe_context functions
[mesa.git] / src / gallium / drivers / i965 / brw_pipe_flush.c
1
2 #include "util/u_upload_mgr.h"
3
4 #include "brw_context.h"
5 #include "brw_batchbuffer.h"
6
7
8
9 /* All batchbuffer flushes must go through this function.
10 */
11 void brw_context_flush( struct brw_context *brw )
12 {
13 /*
14 *
15 */
16 brw_emit_query_end(brw);
17
18 /* Move to the end of the current upload buffer so that we'll force choosing
19 * a new buffer next time.
20 */
21 u_upload_flush( brw->vb.upload_vertex );
22 u_upload_flush( brw->vb.upload_index );
23
24 _brw_batchbuffer_flush( brw->batch, __FILE__, __LINE__ );
25
26 /* Mark all context state as needing to be re-emitted.
27 * This is probably not as severe as on 915, since almost all of our state
28 * is just in referenced buffers.
29 */
30 brw->state.dirty.brw |= BRW_NEW_CONTEXT;
31 brw->state.dirty.mesa |= ~0;
32 brw->state.dirty.brw |= ~0;
33 brw->state.dirty.cache |= ~0;
34
35 brw->curbe.need_new_bo = GL_TRUE;
36 }
37
38 static void
39 brw_flush( struct pipe_context *pipe,
40 unsigned flags,
41 struct pipe_fence_handle **fence )
42 {
43 brw_context_flush( brw_context( pipe ) );
44 *fence = NULL;
45 }
46
47
48 void brw_pipe_flush_init( struct brw_context *brw )
49 {
50 brw->base.flush = brw_flush;
51 }
52
53
54 void brw_pipe_flush_cleanup( struct brw_context *brw )
55 {
56 }