aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_curbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_curbe.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index 80479416028..0a3600193b2 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -46,7 +46,7 @@
/* Partition the CURBE between the various users of constant values:
*/
-static int calculate_curbe_offsets( struct brw_context *brw )
+static void calculate_curbe_offsets( struct brw_context *brw )
{
/* CACHE_NEW_WM_PROG */
GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16;
@@ -117,7 +117,6 @@ static int calculate_curbe_offsets( struct brw_context *brw )
brw->state.dirty.brw |= BRW_NEW_CURBE_OFFSETS;
}
- return 0;
}
@@ -171,7 +170,7 @@ static GLfloat fixed_plane[6][4] = {
* cache mechanism, but maybe would benefit from a comparison against
* the current uploaded set of constants.
*/
-static int prepare_constant_buffer(struct brw_context *brw)
+static void prepare_constant_buffer(struct brw_context *brw)
{
GLcontext *ctx = &brw->intel.ctx;
struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program;
@@ -195,8 +194,8 @@ static int prepare_constant_buffer(struct brw_context *brw)
brw->curbe.last_buf = NULL;
brw->curbe.last_bufsz = 0;
}
-
- return 0;
+
+ return;
}
buf = (GLfloat *)malloc(bufsz);
@@ -321,9 +320,6 @@ static int prepare_constant_buffer(struct brw_context *brw)
* flushes as necessary when doublebuffering of CURBEs isn't
* possible.
*/
-
- /* check aperture space for this bo */
- return dri_bufmgr_check_aperture_space(brw->curbe.curbe_bo);
}
@@ -331,6 +327,13 @@ static void emit_constant_buffer(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
GLuint sz = brw->curbe.total_size;
+ dri_bo *aper_array[] = {
+ brw->intel.batch->buf,
+ brw->curbe.curbe_bo,
+ };
+
+ if (dri_bufmgr_check_aperture_space(aper_array, ARRAY_SIZE(aper_array)))
+ intel_batchbuffer_flush(intel->batch);
BEGIN_BATCH(2, IGNORE_CLIPRECTS);
if (sz == 0) {