From f5a4489fd9f59480fbffa64516ead7177a712b40 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Thu, 4 Jul 2024 20:16:58 +0200 Subject: [PATCH] don't call `drain_transitions()` of we drop the results --- wgpu-core/src/resource.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index e00a942a9..8d794e9df 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -609,14 +609,13 @@ impl Buffer { }; } - let snatch_guard = device.snatchable_lock.read(); - { - let mut trackers = device.as_ref().trackers.lock(); - trackers.buffers.set_single(self, internal_use); - //TODO: Check if draining ALL buffers is correct! - let _ = trackers.buffers.drain_transitions(&snatch_guard); - } - drop(snatch_guard); + // TODO: we are ignoring the transition here, I think we need to add a barrier + // at the end of the submission + device + .trackers + .lock() + .buffers + .set_single(self, internal_use); device.lock_life().map(self);