zink: flag has_work in a few more places

it's unlikely that any of these would be hit without first triggering
a has_work elsewhere, but this makes it more obvious

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29108>
This commit is contained in:
Mike Blumenkrantz
2024-05-08 13:22:00 -04:00
committed by Marge Bot
parent 8f687f2a46
commit 74f572b28f
5 changed files with 12 additions and 1 deletions
+1
View File
@@ -881,6 +881,7 @@ zink_end_batch(struct zink_context *ctx)
if (sem)
util_dynarray_append(&ctx->bs->signal_semaphores, VkSemaphore, sem);
}
bs->has_work = true;
}
if (screen->threaded_submit) {
+1
View File
@@ -108,6 +108,7 @@ clear_in_rp(struct pipe_context *pctx,
cr.layerCount = util_framebuffer_get_num_layers(fb);
assert(ctx->in_rp);
VKCTX(CmdClearAttachments)(ctx->bs->cmdbuf, num_attachments, attachments, 1, &cr);
ctx->bs->has_work = true;
/*
Rendering within a subpass containing a feedback loop creates a data race, except in the following
cases:
+7
View File
@@ -3026,6 +3026,10 @@ zink_batch_rp(struct zink_context *ctx)
else
clear_buffers = begin_rendering(ctx);
assert(!ctx->rp_changed);
if (ctx->unordered_blitting)
ctx->bs->has_reordered_work = true;
else
ctx->bs->has_work = true;
/* update the render-passes HUD query */
ctx->hud.render_passes++;
@@ -4071,6 +4075,7 @@ zink_texture_barrier(struct pipe_context *pctx, unsigned flags)
0, NULL
);
}
ctx->bs->has_work = true;
}
static inline void
@@ -4083,6 +4088,7 @@ mem_barrier(struct zink_context *ctx, VkPipelineStageFlags src_stage, VkPipeline
mb.dstAccessMask = dst;
zink_batch_no_rp(ctx);
VKCTX(CmdPipelineBarrier)(ctx->bs->cmdbuf, src_stage, dst_stage, 0, 1, &mb, 0, NULL, 0, NULL);
ctx->bs->has_work = true;
}
void
@@ -5231,6 +5237,7 @@ zink_flush_dgc(struct zink_context *ctx)
pipe_resource_reference(&pres, NULL);
}
ctx->bs->has_work = true;
util_dynarray_clear(&ctx->dgc.pipelines);
util_dynarray_clear(&ctx->dgc.tokens);
ctx->dgc.valid = false;
-1
View File
@@ -1118,7 +1118,6 @@ zink_draw(struct pipe_context *pctx,
VKCTX(CmdEndTransformFeedbackEXT)(bs->cmdbuf, 0, ctx->num_so_targets, counter_buffers, counter_buffer_offsets);
}
bs->has_work = true;
ctx->last_work_was_compute = false;
ctx->work_count = work_count;
/* flush if there's >100k draws */
+3
View File
@@ -775,6 +775,7 @@ copy_pool_results_to_buffer(struct zink_context *ctx, struct zink_query *query,
util_range_add(&res->base.b, &res->valid_buffer_range, offset, offset + result_size);
assert(query_id < NUM_QUERIES);
res->obj->unordered_read = res->obj->unordered_write = false;
ctx->bs->has_work = true;
VKCTX(CmdCopyQueryPoolResults)(ctx->bs->cmdbuf, pool, query_id, num_results, res->obj->buffer,
offset, base_result_size, flags);
zink_cmd_debug_marker_end(ctx, ctx->bs->cmdbuf, marker);
@@ -1089,6 +1090,7 @@ zink_end_query(struct pipe_context *pctx,
struct zink_query_start *start = util_dynarray_top_ptr(&query->starts, struct zink_query_start);
VKCTX(CmdWriteTimestamp)(ctx->bs->cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
start->vkq[0]->pool->query_pool, start->vkq[0]->query_id);
ctx->bs->has_work = true;
zink_batch_usage_set(&query->batch_uses, ctx->bs);
_mesa_set_add(&ctx->bs->active_queries, query);
query->needs_update = true;
@@ -1328,6 +1330,7 @@ zink_render_condition(struct pipe_context *pctx,
VkQueryResultFlagBits flags = 0;
zink_flush_dgc_if_enabled(ctx);
ctx->bs->has_work = true;
if (query == NULL) {
/* force conditional clears if they exist */
if (ctx->clears_enabled && !ctx->in_rp)