barriers just trigger a full flush, which is unnecessary if it's:
* the first cmd in a cmdbuf, as the previous cmdbuf will have already
flushed and so this is flushing nothing
* the last cmd in a cmdbuf, as there will be a flush immediately after
returning from this function
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10762>
struct rendering_state *state)
{
struct lvp_cmd_buffer_entry *cmd;
+ bool first = true;
LIST_FOR_EACH_ENTRY(cmd, &cmd_buffer->cmds, cmd_link) {
switch (cmd->cmd_type) {
handle_wait_events(cmd, state);
break;
case LVP_CMD_PIPELINE_BARRIER:
+ /* skip flushes since every cmdbuf does a flush
+ after iterating its cmds and so this is redundant
+ */
+ if (first || cmd->cmd_link.next == &cmd_buffer->cmds)
+ continue;
handle_pipeline_barrier(cmd, state);
break;
case LVP_CMD_BEGIN_QUERY:
handle_set_stencil_op(cmd, state);
break;
}
+ first = false;
}
}