anv: Slow clear if fast-clear cost is not mitigated
Fast-clears require expensive flushes beforehand and afterwards. The cost of flushes are decreased in a series of back-to-back fast-clears as no extra fast-clear flushes are required in between them. If the ratio of a command buffer's recorded back-to-back fast clears over independent fast-clears falls below 1/2, prevent that command buffer from recording any further fast-clears. Averaging two runs of our Factorio trace on an A750 shows a +14.37% improvement in FPS. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32984>
This commit is contained in:
@@ -3108,6 +3108,14 @@ genX(cmd_buffer_update_color_aux_op)(struct anv_cmd_buffer *cmd_buffer,
|
||||
} else {
|
||||
cmd_buffer->state.color_aux_op = next_aux_op;
|
||||
}
|
||||
|
||||
if (next_aux_op == ISL_AUX_OP_FAST_CLEAR) {
|
||||
if (aux_op_clears(last_aux_op)) {
|
||||
cmd_buffer->num_dependent_clears++;
|
||||
} else {
|
||||
cmd_buffer->num_independent_clears++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user