From 83e1ba5235ac54c73753fd570d912e2503e2fd14 Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Tue, 6 Oct 2026 17:47:34 +0300 Subject: [PATCH] [GPU] Cancel pending control barriers when the command stream is discarded Co-authored-by: Sekai <140012992+igettingit@users.noreply.github.com> --- src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs index 918a128..1db6ec3 100644 --- a/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs +++ b/src/SharpEmu.Libs/Gpu/GpuCommands/CommandStreamQueue.cs @@ -664,12 +664,17 @@ public sealed class CommandStreamQueue // Drops every submission without stopping admission; the presenter uses it after device loss. public void DiscardAll() { + Action[] cancellations; lock (_gate) { _outcome = IdleOutcome.Failed; DropAllLocked(); + cancellations = CancelControlBarriersLocked(); Monitor.PulseAll(_gate); } + + foreach (var cancel in cancellations) + cancel(); } // A diagnostic view of the blocked heads: their count, the oldest age and one sample.