diff options
author | Dave Airlie <[email protected]> | 2008-04-17 17:17:23 +1000 |
---|---|---|
committer | Dave Airlie <airlied@panoply-rh.(none)> | 2008-04-18 11:57:38 +1000 |
commit | 008653ac55776d6b1c6d1627ad20937aa1c4dbda (patch) | |
tree | fad31aa8394c539980437ad58642971eb8ba9ca1 /src/mesa/drivers/dri/i965/brw_gs.c | |
parent | 08f9b190a798c9c61ae07208345d0c2b37e54d39 (diff) |
i965: initial attempt at fixing the aperture overflow
Makes state emission into a 2 phase, prepare sets things up and accounts
the size of all referenced buffer objects. The emit stage then actually
does the batchbuffer touching for emitting the objects.
There is an assert in dri_emit_reloc if a reloc occurs for a buffer
that hasn't been accounted yet.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_gs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 922a3ba3a51..8ad27624d5d 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -162,7 +162,7 @@ static void populate_key( struct brw_context *brw, /* Calculate interpolants for triangle and line rasterization. */ -static void upload_gs_prog( struct brw_context *brw ) +static int prepare_gs_prog( struct brw_context *brw ) { struct brw_gs_prog_key key; @@ -184,6 +184,8 @@ static void upload_gs_prog( struct brw_context *brw ) if (brw->gs.prog_bo == NULL) compile_gs_prog( brw, &key ); } + + return dri_bufmgr_check_aperture_space(brw->gs.prog_bo); } @@ -193,5 +195,5 @@ const struct brw_tracked_state brw_gs_prog = { .brw = BRW_NEW_PRIMITIVE, .cache = CACHE_NEW_VS_PROG }, - .update = upload_gs_prog + .prepare = prepare_gs_prog }; |