diff options
author | Kenneth Graunke <[email protected]> | 2014-05-13 20:51:32 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-05-18 23:35:18 -0700 |
commit | 7e28bd797dbe1721e5d97916f041493d1f30220d (patch) | |
tree | 27ce489279574328cc8f41a0391951e942db05f1 /src/mesa | |
parent | c51163b0cf7aff0375b1a5ea4cb3da9d9e164044 (diff) |
i965/fs: Move total_scratch calculation into fs_visitor::run().
With this one use gone, c->last_scratch is now only used inside
fs_visitor. The rest of the driver uses prog_data->total_scratch.
We already compute similar prog_data fields in fs_visitor, so this
seems reasonable.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index ed5bb0755f7..ea3c8dead53 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -3093,6 +3093,10 @@ fs_visitor::run() if (!allocated_without_spills) schedule_instructions(SCHEDULE_POST); + if (c->last_scratch > 0) { + c->prog_data.total_scratch = brw_get_scratch_size(c->last_scratch); + } + if (dispatch_width == 8) c->prog_data.reg_blocks = brw_register_blocks(grf_used); else diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index cda86895bb5..5242715603a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -184,10 +184,7 @@ bool do_wm_prog(struct brw_context *brw, if (program == NULL) return false; - /* Scratch space is used for register spilling */ - if (c->last_scratch) { - c->prog_data.total_scratch = brw_get_scratch_size(c->last_scratch); - + if (c->prog_data.total_scratch) { brw_get_scratch_bo(brw, &brw->wm.base.scratch_bo, c->prog_data.total_scratch * brw->max_wm_threads); } |