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 <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
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
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);
}