lavapipe: force state updates when beginning queries

the full state update is maybe not entirely necessary since this is just
to address descriptor use, but probably it won't hurt

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
This commit is contained in:
Mike Blumenkrantz
2021-03-18 13:36:49 -04:00
parent 007bf1d1dc
commit 6d995d3fe2
@@ -2258,6 +2258,18 @@ static void handle_pipeline_barrier(struct lvp_cmd_buffer_entry *cmd,
state->pctx->flush(state->pctx, NULL, 0);
}
static void maybe_emit_state_for_begin_query(struct lvp_cmd_buffer_entry *cmd,
struct rendering_state *state)
{
struct lvp_cmd_query_cmd *qcmd = &cmd->u.query;
struct lvp_query_pool *pool = qcmd->pool;
if (pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS &&
pool->pipeline_stats & VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT)
emit_compute_state(state);
emit_state(state);
}
static void handle_begin_query(struct lvp_cmd_buffer_entry *cmd,
struct rendering_state *state)
{
@@ -2963,6 +2975,7 @@ static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
handle_pipeline_barrier(cmd, state);
break;
case LVP_CMD_BEGIN_QUERY:
maybe_emit_state_for_begin_query(cmd, state);
handle_begin_query(cmd, state);
break;
case LVP_CMD_END_QUERY: