brw_pipe_query.c \
brw_pipe_shader.c \
brw_pipe_flush.c \
+ brw_pipe_misc.c \
brw_pipe_rast.c \
brw_sf.c \
brw_sf_emit.c \
void _brw_batchbuffer_flush(struct brw_batchbuffer *batch,
const char *file, int line);
-#define brw_batchbuffer_flush(batch) \
- _brw_batchbuffer_flush(batch, __FILE__, __LINE__)
void brw_batchbuffer_reset(struct brw_batchbuffer *batch);
brw_draw_cleanup( brw );
+ brw_pipe_blend_cleanup( brw );
+ brw_pipe_depth_stencil_cleanup( brw );
+ brw_pipe_framebuffer_cleanup( brw );
+ brw_pipe_flush_cleanup( brw );
+ brw_pipe_misc_cleanup( brw );
+ brw_pipe_query_cleanup( brw );
+ brw_pipe_rast_cleanup( brw );
+ brw_pipe_sampler_cleanup( brw );
+ brw_pipe_shader_cleanup( brw );
+ brw_pipe_vertex_cleanup( brw );
+
FREE(brw->wm.compile_data);
for (i = 0; i < brw->curr.fb.nr_cbufs; i++)
brw->base.destroy = brw_destroy_context;
- brw_init_query( brw );
+ brw_pipe_blend_init( brw );
+ brw_pipe_depth_stencil_init( brw );
+ brw_pipe_framebuffer_init( brw );
+ brw_pipe_flush_init( brw );
+ brw_pipe_misc_init( brw );
+ brw_pipe_query_init( brw );
+ brw_pipe_rast_init( brw );
+ brw_pipe_sampler_init( brw );
+ brw_pipe_shader_init( brw );
+ brw_pipe_vertex_init( brw );
+
brw_init_state( brw );
brw_draw_init( brw );
void brw_pipe_vertex_cleanup( struct brw_context *brw );
+void brw_context_flush( struct brw_context *brw );
+
+
/* brw_urb.c
*/
int brw_upload_urb_fence(struct brw_context *brw);
return ret;
if (brw->flags.always_flush_batch)
- brw_batchbuffer_flush(brw->batch);
+ brw_context_flush( brw );
return 0;
}
/* Otherwise, flush and retry:
*/
if (ret != 0) {
- brw_batchbuffer_flush(brw->batch);
+ brw_context_flush( brw );
ret = try_draw_range_elements(brw, index_buffer, hw_prim, start, count );
assert(ret == 0);
}
#include "util/u_upload_mgr.h"
#include "brw_context.h"
+#include "brw_batchbuffer.h"
-/**
- * called from brw_batchbuffer_flush and children before sending a
- * batchbuffer off.
+
+/* All batchbuffer flushes must go through this function.
*/
-static void brw_finish_batch(struct brw_context *brw)
+void brw_context_flush( struct brw_context *brw )
{
+ /*
+ *
+ */
brw_emit_query_end(brw);
-}
+ /* Move to the end of the current upload buffer so that we'll force choosing
+ * a new buffer next time.
+ */
+ u_upload_flush( brw->vb.upload_vertex );
+ u_upload_flush( brw->vb.upload_index );
-/**
- * called from intelFlushBatchLocked
- */
-static void brw_new_batch( struct brw_context *brw )
-{
- brw->curbe.need_new_bo = GL_TRUE;
+ _brw_batchbuffer_flush( brw->batch, __FILE__, __LINE__ );
/* Mark all context state as needing to be re-emitted.
* This is probably not as severe as on 915, since almost all of our state
* is just in referenced buffers.
*/
brw->state.dirty.brw |= BRW_NEW_CONTEXT;
-
brw->state.dirty.mesa |= ~0;
brw->state.dirty.brw |= ~0;
brw->state.dirty.cache |= ~0;
- /* Move to the end of the current upload buffer so that we'll force choosing
- * a new buffer next time.
- */
- u_upload_flush( brw->vb.upload_vertex );
- u_upload_flush( brw->vb.upload_index );
+ brw->curbe.need_new_bo = GL_TRUE;
+}
+static void
+brw_flush( struct pipe_context *pipe,
+ unsigned flags,
+ struct pipe_fence_handle **fence )
+{
+ brw_context_flush( brw_context( pipe ) );
+ *fence = NULL;
}
-/* called from intelWaitForIdle() and intelFlush()
- *
- * For now, just flush everything. Could be smarter later.
- */
-static GLuint brw_flush_cmd( void )
+
+void brw_pipe_flush_init( struct brw_context *brw )
{
- return ((MI_FLUSH << 16) | BRW_FLUSH_STATE_CACHE);
+ brw->base.flush = brw_flush;
}
+void brw_pipe_flush_cleanup( struct brw_context *brw )
+{
+}
+#include "brw_context.h"
+#include "brw_structs.h"
+#include "brw_defines.h"
+
static void brw_set_polygon_stipple( struct pipe_context *pipe,
- const unsigned *stipple )
+ const struct pipe_poly_stipple *stip )
{
+ struct brw_context *brw = brw_context(pipe);
struct brw_polygon_stipple *bps = &brw->curr.bps;
GLuint i;
bps->header.length = sizeof *bps/4-2;
for (i = 0; i < 32; i++)
- bps->stipple[i] = brw->curr.poly_stipple[i]; /* don't invert */
+ bps->stipple[i] = stip->stipple[i]; /* don't invert */
+}
+
+
+
+void brw_pipe_misc_init( struct brw_context *brw )
+{
+ brw->base.set_polygon_stipple = brw_set_polygon_stipple;
+}
+
+
+void brw_pipe_misc_cleanup( struct brw_context *brw )
+{
}
*/
if (query->bo) {
brw_emit_query_end(brw);
- brw_batchbuffer_flush(brw->batch);
+ brw_context_flush( brw );
brw->sws->bo_unreference(brw->query.bo);
brw->query.bo = NULL;
}
-void brw_sampler_init( struct brw_context *brw )
+void brw_pipe_sampler_init( struct brw_context *brw )
{
brw->base.set_sampler_textures = brw_set_sampler_textures;
brw->base.create_sampler_state = brw_create_sampler_state;
brw->base.bind_sampler_state = brw_bind_sampler_state;
brw->base.destroy_sampler_state = brw_destroy_sampler_state;
}
+
+void brw_pipe_sampler_cleanup( struct brw_context *brw )
+{
+}