mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
d3d12: drop peer-batch peeking in resource_is_busy / wait_idle
Assisted-by: Claude Opus 4.7 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41322>
This commit is contained in:
parent
18012b69ab
commit
955b2672d3
1 changed files with 19 additions and 11 deletions
|
|
@ -106,12 +106,13 @@ resource_is_busy(struct d3d12_context *ctx,
|
|||
if (d3d12_batch_has_references(d3d12_current_batch(ctx), res->bo, want_to_write))
|
||||
return true;
|
||||
|
||||
bool busy = false;
|
||||
d3d12_foreach_submitted_batch(ctx, batch) {
|
||||
if (!d3d12_reset_batch(ctx, batch, 0))
|
||||
busy |= d3d12_batch_has_references(batch, res->bo, want_to_write);
|
||||
}
|
||||
return busy;
|
||||
d3d12_foreach_submitted_batch(ctx, batch)
|
||||
d3d12_reset_batch(ctx, batch, 0);
|
||||
|
||||
uint64_t offset;
|
||||
struct d3d12_bo *base = d3d12_bo_get_base(res->bo, &offset);
|
||||
struct d3d12_screen *screen = d3d12_screen(ctx->base.screen);
|
||||
return base->last_used_fence > screen->fence->GetCompletedValue();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -121,12 +122,19 @@ d3d12_resource_wait_idle(struct d3d12_context *ctx,
|
|||
{
|
||||
if (d3d12_batch_has_references(d3d12_current_batch(ctx), res->bo, want_to_write)) {
|
||||
d3d12_flush_cmdlist_and_wait(ctx);
|
||||
} else {
|
||||
d3d12_foreach_submitted_batch(ctx, batch) {
|
||||
if (d3d12_batch_has_references(batch, res->bo, want_to_write))
|
||||
d3d12_reset_batch(ctx, batch, OS_TIMEOUT_INFINITE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t offset;
|
||||
struct d3d12_bo *base = d3d12_bo_get_base(res->bo, &offset);
|
||||
struct d3d12_screen *screen = d3d12_screen(ctx->base.screen);
|
||||
uint64_t target = base->last_used_fence;
|
||||
if (target > screen->fence->GetCompletedValue())
|
||||
screen->fence->SetEventOnCompletion(target, nullptr);
|
||||
|
||||
d3d12_foreach_submitted_batch(ctx, batch)
|
||||
d3d12_reset_batch(ctx, batch, 0);
|
||||
d3d12_screen_reclaim_completed(screen);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue