zink: avoid emitting unnecessary pipeline barriers during update_descriptors
if the current state of the resource matches the desired state, we don't need to emit anything, and we can potentially avoid ending a renderpass Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8945>
This commit is contained in:
parent
5d7cb2495a
commit
017dbd63fb
|
@ -425,14 +425,18 @@ update_descriptors(struct zink_context *ctx, struct zink_screen *screen, bool is
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zink_batch *batch;
|
struct zink_batch *batch = NULL;
|
||||||
if (num_transitions > 0) {
|
if (num_transitions > 0) {
|
||||||
if (is_compute)
|
|
||||||
batch = &ctx->compute_batch;
|
|
||||||
else
|
|
||||||
batch = zink_batch_no_rp(ctx);
|
|
||||||
|
|
||||||
for (int i = 0; i < num_transitions; ++i) {
|
for (int i = 0; i < num_transitions; ++i) {
|
||||||
|
if (!zink_resource_needs_barrier(transitions[i].res,
|
||||||
|
transitions[i].layout,
|
||||||
|
transitions[i].stage))
|
||||||
|
continue;
|
||||||
|
if (is_compute)
|
||||||
|
batch = &ctx->compute_batch;
|
||||||
|
else
|
||||||
|
batch = zink_batch_no_rp(ctx);
|
||||||
|
|
||||||
if (transitions[i].res->base.target == PIPE_BUFFER)
|
if (transitions[i].res->base.target == PIPE_BUFFER)
|
||||||
zink_resource_buffer_barrier(batch->cmdbuf, transitions[i].res,
|
zink_resource_buffer_barrier(batch->cmdbuf, transitions[i].res,
|
||||||
transitions[i].layout, transitions[i].stage);
|
transitions[i].layout, transitions[i].stage);
|
||||||
|
|
Loading…
Reference in New Issue